From d18f8c623490fe3f92ceaa5ed2b73ed45912fb8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Sat, 7 Jun 2025 11:10:05 +0800 Subject: [PATCH] Fix SQL Errors. --- createDatabase.ts | 2 +- server/components/customgroqsystem.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/createDatabase.ts b/createDatabase.ts index 7a2dd4b..0b85189 100644 --- a/createDatabase.ts +++ b/createDatabase.ts @@ -35,7 +35,7 @@ CREATE TABLE IF NOT EXISTS chat_history ( const createUserOtherData = await sql` create table if not exists user_other_data ( user_id text primary key, - user text not null unique, + username text not null unique, groq_api_key text, starred_news JSON not null, translate_provider text, diff --git a/server/components/customgroqsystem.ts b/server/components/customgroqsystem.ts index 5d4c85c..49c9484 100644 --- a/server/components/customgroqsystem.ts +++ b/server/components/customgroqsystem.ts @@ -19,7 +19,7 @@ export async function checkIfUserHasCustomGroqKey(token?: string) { } const fetchUserToken = await sql` select groq_api_key from user_other_data - where user=${checkRealToken[0].username}`; + where username=${checkRealToken[0].username}`; if (fetchUserToken.length === 0) { return { status: false,