API: DELETE /reports.php?id=X — Bericht löschen (für PWA) [deploy]
All checks were successful
Deploy bericht / deploy (push) Successful in 1s
All checks were successful
Deploy bericht / deploy (push) Successful in 1s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7e199a79ad
commit
5fc6338ced
1 changed files with 7 additions and 0 deletions
|
|
@ -113,6 +113,13 @@ if (!$id) api_fail('id erforderlich');
|
|||
$bericht = new Bericht($db);
|
||||
if ($bericht->fetch($id) <= 0) api_fail('Bericht nicht gefunden', 404);
|
||||
|
||||
/* ----- DELETE: Bericht löschen ----- */
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'DELETE') {
|
||||
if (!$user->hasRight('bericht', 'delete')) api_fail('Löschrechte fehlen', 403);
|
||||
if ($bericht->delete($user) <= 0) api_fail('Löschen fehlgeschlagen', 500);
|
||||
api_ok(array('deleted' => true, 'id' => $id));
|
||||
}
|
||||
|
||||
if ($action === 'finalize') {
|
||||
if (!$user->hasRight('bericht', 'write')) api_fail('Schreibrechte fehlen', 403);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue