Made a working settings panel & includes the user's info, what is
Some checks are pending
Build and Push Docker Image / build-and-push (push) Waiting to run

missing? well, all the actions that requires the data to be sent to the
server is still not there yet. Tried to add onboarding, but I have just
no idea how to do it (Maybe I can do it w/ a video?
This commit is contained in:
yuanhau 2025-06-07 23:51:05 +08:00
parent 1eb15058d7
commit 29760dda96
6 changed files with 201 additions and 63 deletions

View file

@ -1,7 +1,7 @@
import sql from "~/server/components/postgres";
export default defineEventHandler(async (event) => {
const body = await readBody(event);
const { request_change } = body;
/*
const userToken = getCookie(event, "token");
if (!userToken) {
return {
@ -19,5 +19,6 @@ export default defineEventHandler(async (event) => {
}
if (request_change === "groq_api_key") {
const updateListing = await sql``;
}
}*/
return { body: body };
});

View file

@ -39,6 +39,7 @@ export default defineEventHandler(async (event) => {
}
return {
userAccount: fetchViaSQL[0].username,
firstName: fetchViaSQL[0].firstName,
requested_action: "CONTINUE",
email: fetchViaSQL[0].email,
avatarURL: fetchViaSQL[0].avatarurl,

View file

@ -19,7 +19,7 @@ export async function checkIfUserHasCustomGroqKey(token?: string) {
}
const fetchUserToken = await sql`
select groq_api_key from user_other_data
where username=${checkRealToken[0].username}`;
where username = ${checkRealToken[0].username}`;
if (fetchUserToken.length === 0) {
return {
status: false,