remove unnecessary startTransaction and commit calls

This commit is contained in:
bence committed 2023-04-20 00:39:10 +02:00
1 parent 8141845ae9
commit ee4a9f2ce3
3 files changed
-32

No files matched your search

-8
View File
@@ -104,8 +104,6 @@ class MapAdminController implements IAuthenticationRequired, ISecured
{
$mapId = (int) $this->request->query('mapId');
\Container::$dbConnection->startTransaction();
if ($mapId) {
$map = $this->mapRepository->getById($mapId);
} else {
@@ -186,8 +184,6 @@ class MapAdminController implements IAuthenticationRequired, ISecured
$this->pdm->saveToDb($map);
\Container::$dbConnection->commit();
return new JsonContent(['mapId' => $map->getId(), 'added' => $addedIds]);
}
@@ -197,14 +193,10 @@ class MapAdminController implements IAuthenticationRequired, ISecured
$map = $this->mapRepository->getById($mapId);
\Container::$dbConnection->startTransaction();
$this->deletePlaces($map);
$this->pdm->deleteFromDb($map);
\Container::$dbConnection->commit();
return new JsonContent(['success' => true]);
}