This commit is contained in:
@ -75,6 +75,8 @@ case 'POST':
|
||||
'type' => $type, 'orderIndex' => $order, 'isRequired' => $req,
|
||||
'configJson' => $config, 'answerOptions' => [], 'translations' => [],
|
||||
]]);
|
||||
} catch (QdbHttpResponse $e) {
|
||||
throw $e;
|
||||
} catch (Throwable $e) {
|
||||
qdb_discard($tmpDb, $lockFp);
|
||||
error_log($e->getMessage());
|
||||
@ -111,6 +113,8 @@ case 'PUT':
|
||||
'defaultText' => $text, 'type' => $type, 'orderIndex' => $order, 'isRequired' => $req,
|
||||
'configJson' => $config,
|
||||
]]);
|
||||
} catch (QdbHttpResponse $e) {
|
||||
throw $e;
|
||||
} catch (Throwable $e) {
|
||||
qdb_discard($tmpDb, $lockFp);
|
||||
error_log($e->getMessage());
|
||||
@ -142,6 +146,8 @@ case 'DELETE':
|
||||
$pdo->exec("PRAGMA foreign_keys = ON;");
|
||||
qdb_save($tmpDb, $lockFp);
|
||||
json_success(['deleted' => true]);
|
||||
} catch (QdbHttpResponse $e) {
|
||||
throw $e;
|
||||
} catch (Throwable $e) {
|
||||
if ($pdo->inTransaction()) {
|
||||
$pdo->rollBack();
|
||||
@ -166,6 +172,8 @@ case 'PATCH':
|
||||
}
|
||||
qdb_save($tmpDb, $lockFp);
|
||||
json_success(['reordered' => true]);
|
||||
} catch (QdbHttpResponse $e) {
|
||||
throw $e;
|
||||
} catch (Throwable $e) {
|
||||
qdb_discard($tmpDb, $lockFp);
|
||||
error_log($e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user