Add market occurrence delete confirmation

This commit is contained in:
gitea_admin committed 2026-09-19 15:39:05 +02:00
1 parent 30e44755fe
commit ca42ded4e2
2 files changed
+12 -4

No files matched your search

+6 -1
View File
@@ -37,7 +37,12 @@ if ($requestMethod === 'POST') {
$scope = (string) ($payload['scope'] ?? '');
$id = market_management_require_positive_id($payload['id'] ?? null, 'id');
$fields = is_array($payload['fields'] ?? null) ? $payload['fields'] : [];
if ($scope === 'day') {
if (($payload['action'] ?? '') === 'delete') {
if (($payload['confirmation'] ?? '') !== 'DELETE') {
throw new InvalidArgumentException('Die Löschbestätigung muss exakt DELETE lauten.');
}
market_management_set_occurrence_archive($pdo, $id, true);
} elseif ($scope === 'day') {
market_management_update_day($pdo, $id, $fields);
} elseif (in_array($scope, ['occurrence', 'status', 'overview', 'participation', 'infrastructure', 'travel', 'notes'], true)) {
$marketFields = [];