fix: pannello contenuti — PUT ritorna value salvato, data-q aggiornato, guard hash, aria-label

This commit is contained in:
2026-07-05 17:35:41 +02:00
parent be52781499
commit 608b1b68d2
2 changed files with 16 additions and 8 deletions
+4 -1
View File
@@ -14,5 +14,8 @@ export const PUT: APIRoute = async ({ params, request, locals }) => {
const r = applyContentUpdate(getDb(), params.tag ?? '', data, locals.user!.username);
if (!r.ok) return json(r.status, { error: r.error });
invalidateContentCache();
return json(200, { ok: true });
// Il value salvato può differire da quello inviato (sanitizeInline sui tag html):
// lo restituiamo così il pannello mostra il dato reale.
const row = getDb().prepare('SELECT value FROM content_blocks WHERE tag = ?').get(params.tag) as { value: string };
return json(200, { ok: true, value: row.value });
};