From 5fc6338ced4d5fbe7ede2c2843f465946990e590 Mon Sep 17 00:00:00 2001 From: Eduard Wisch Date: Fri, 10 Apr 2026 15:32:33 +0200 Subject: [PATCH] =?UTF-8?q?API:=20DELETE=20/reports.php=3Fid=3DX=20?= =?UTF-8?q?=E2=80=94=20Bericht=20l=C3=B6schen=20(f=C3=BCr=20PWA)=20[deploy?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- api/reports.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/reports.php b/api/reports.php index 87c5c0d..7f703fe 100644 --- a/api/reports.php +++ b/api/reports.php @@ -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);