IT WORKS NOW :))))))) (The send groq api key part)

This commit is contained in:
yuanhau 2025-06-09 11:34:33 +08:00
parent e2b4acb68b
commit 2ef4cd9277
2 changed files with 9 additions and 4 deletions

View file

@ -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,
};
}
});