improved condition json to have UI integration

This commit is contained in:
2026-05-28 12:26:45 +02:00
parent 9cf67e765f
commit 9a6fa22d84
5 changed files with 932 additions and 27 deletions

View File

@ -49,6 +49,25 @@ case 'POST':
require_role(['admin', 'supervisor'], $tokenRec);
$body = read_json_body();
if (($body['action'] ?? '') === 'updateConditionMessageLabel') {
$messageKey = trim((string)($body['messageKey'] ?? ''));
$germanLabel = (string)($body['germanLabel'] ?? '');
[$pdo, $tmpDb, $lockFp] = qdb_open(true);
try {
qdb_set_app_string_german_label($pdo, $messageKey, $germanLabel);
qdb_save($tmpDb, $lockFp);
json_success([
'messageKey' => qdb_validate_stable_key($messageKey, 'messageKey'),
'germanLabel' => trim($germanLabel),
]);
} catch (Throwable $e) {
qdb_discard($tmpDb, $lockFp);
error_log('updateConditionMessageLabel: ' . $e->getMessage());
json_error('SERVER_ERROR', 'Server error', 500);
}
break;
}
if (($body['action'] ?? '') === 'updateCategoryLabel') {
$categoryKey = trim((string)($body['categoryKey'] ?? ''));
$germanLabel = (string)($body['germanLabel'] ?? '');