fix branding
All checks were successful
Build & Push Docker Image / build (push) Successful in 1m8s

This commit is contained in:
2026-02-24 19:47:23 +01:00
parent cd98ee4cc7
commit 69a3c83436

View File

@@ -50,12 +50,11 @@ async function getSetting(key) {
// Helper: set setting in DB
async function setSetting(key, value) {
const db = getDb();
// Upsert
const existing = await db.get('SELECT key FROM settings WHERE key = ?', [key]);
if (existing) {
await db.run('UPDATE settings SET value = ?, updated_at = CURRENT_TIMESTAMP WHERE key = ?', [value, key]);
} else {
await db.run('INSERT INTO settings (key, value) VALUES (?, ?)', [key, value]);
// Try update first, then insert if nothing was updated
const result = await db.run('UPDATE settings SET value = ?, updated_at = CURRENT_TIMESTAMP WHERE key = ?', [value, key]);
if (result.changes === 0) {
// Use INSERT with a dummy RETURNING to satisfy PG adapter, or just use exec-style
await db.run('INSERT INTO settings (key, value) VALUES (?, ?) RETURNING key', [key, value]);
}
}