fix: pannello contenuti — PUT ritorna value salvato, data-q aggiornato, guard hash, aria-label
This commit is contained in:
@@ -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 });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user