From bfdbc16dba3a039dcd0c5e5afc37c943e7e007d6 Mon Sep 17 00:00:00 2001 From: kelvin Date: Thu, 2 Mar 2023 01:58:35 +0900 Subject: [PATCH] fix query --- backend/src/mastodon/client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/mastodon/client.ts b/backend/src/mastodon/client.ts index db8472b..1f96606 100644 --- a/backend/src/mastodon/client.ts +++ b/backend/src/mastodon/client.ts @@ -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) }