Refactor error handling and logging in API responses
This commit is contained in:
@ -3,6 +3,10 @@
|
||||
$tokenRec = require_valid_token_web();
|
||||
require_role(['admin'], $tokenRec);
|
||||
|
||||
if ($method !== 'POST') {
|
||||
json_error('METHOD_NOT_ALLOWED', 'Method not allowed', 405);
|
||||
}
|
||||
|
||||
$dbPath = QDB_PATH;
|
||||
$backupDir = __DIR__ . '/../uploads/backups';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user