diff --git a/backend/classes/controller/FingerprintPostController.php b/backend/classes/controller/FingerprintPostController.php index 19daa57..df31e39 100644 --- a/backend/classes/controller/FingerprintPostController.php +++ b/backend/classes/controller/FingerprintPostController.php @@ -17,6 +17,7 @@ final class FingerprintPostController extends AbstractController $db = new MySqlDatabase(); $json = json_decode($this->requestBody); $fingerprint = new Fingerprint(null, $db); + $this->response = new ApiJsonResponse(); try { $fingerprint->setFingerprint($json->fingerprint); @@ -36,13 +37,10 @@ final class FingerprintPostController extends AbstractController $this->response->setParameter('fingerprintId', $fingerprint->getFingerprintId()); } catch (QrCodeException $e) { - $db->rollback(); - + $this->response->setStatus(ServerStatus::INTERNAL_ERROR); $this->response->setParameter('success', false); - $this->response->setStatus(ServerStatus::INTERNAL_ERROR); - $this->response->setMessage('An error occured during qr code creation!'); + $this->response->setMessage('An error occured during QR code creation!'); } catch (Throwable $e) { - $db->rollback(); $this->catchDatabaseException($e->getMessage(), $json); } }