pull/360/head^2
kelvin 2023-03-02 01:58:35 +09:00
rodzic b25101b72a
commit bfdbc16dba
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -28,7 +28,10 @@ export async function createClient(
INSERT INTO clients (id, secret, name, redirect_uris, website, scopes)
VALUES (?, ?, ?, ?, ?, ?)
`
const { success, error } = await db.prepare(query).bind(id, secret, name, redirect_uris, website, scopes).run()
const { success, error } = await db
.prepare(query)
.bind(id, secret, name, redirect_uris, website === undefined ? null : website, scopes)
.run()
if (!success) {
throw new Error('SQL error: ' + error)
}