mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 15:51:01 +08:00
IT WORKS NOW :))))))) (The send groq api key part)
This commit is contained in:
parent
e2b4acb68b
commit
2ef4cd9277
@ -45,7 +45,7 @@ export default defineEventHandler(async (event) => {
|
||||
error: "CANNOT_CREATE_NEW_USER",
|
||||
};
|
||||
}
|
||||
const createOtherFields = await sql`
|
||||
await sql`
|
||||
insert into user_other_data(user_id, username, translate_enabled, translate_provider, remove_translate_popup, starred_news)
|
||||
values (${userUUID}, ${username}, false, 'google', false, '{}'::JSON)
|
||||
`;
|
||||
|
@ -32,9 +32,13 @@ export default defineEventHandler(async (event) => {
|
||||
if (!allowedColumns.includes(requestChange)) {
|
||||
throw new Error("Invalid column name provided");
|
||||
}
|
||||
const sqlC = await sql.unsafe`
|
||||
UPDATE user_other_data SET ${requestChange} = ${apiKeyqq[0]}
|
||||
WHERE username = ${checkUserToken[0].username}`;
|
||||
|
||||
const sqlC = await sql.unsafe(
|
||||
`
|
||||
UPDATE user_other_data SET ${requestChange} = $1
|
||||
WHERE username = $2`,
|
||||
[apiKeyqq[0], checkUserToken[0].username],
|
||||
);
|
||||
|
||||
/**
|
||||
* // Example of how requestChange might be validated
|
||||
@ -52,6 +56,7 @@ export default defineEventHandler(async (event) => {
|
||||
body: body,
|
||||
allowed: allowed,
|
||||
data: body.value.match(clearBadDataRegex),
|
||||
sqlC: sqlC,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user