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.
pull/372/head
Sven Sauleau 2023-03-06 16:47:21 +00:00
rodzic 5704849170
commit f8206182f3
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -15,7 +15,7 @@ export async function handleRequestGet(db: Database) {
export async function getAdmins(db: Database): Promise<Person[]> {
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<unknown>()
rows = result.success ? (result.results as unknown[]) : []
} catch {