From f8206182f3b9eb5599e44309cfbd13580c0a8545 Mon Sep 17 00:00:00 2001 From: Sven Sauleau Date: Mon, 6 Mar 2023 16:47:21 +0000 Subject: [PATCH] fix SQL is_admin type The `is_admin` column is an `INTEGER`. While SQLite doesn't mind converting `TRUE` to an integer Postgresql is throwing an error. Switch to `1` which is consistent with the column type. --- functions/api/wb/settings/server/admins.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/api/wb/settings/server/admins.ts b/functions/api/wb/settings/server/admins.ts index 51a7dec..143b004 100644 --- a/functions/api/wb/settings/server/admins.ts +++ b/functions/api/wb/settings/server/admins.ts @@ -15,7 +15,7 @@ export async function handleRequestGet(db: Database) { export async function getAdmins(db: Database): Promise { let rows: unknown[] = [] try { - const stmt = db.prepare('SELECT * FROM actors WHERE is_admin=TRUE') + const stmt = db.prepare('SELECT * FROM actors WHERE is_admin=1') const result = await stmt.all() rows = result.success ? (result.results as unknown[]) : [] } catch {