news-analyze/server/api/user/sendUserChanges.post.ts
吳元皓 29760dda96 Made a working settings panel & includes the user's info, what is
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?
2025-06-07 23:51:05 +08:00

25 lines
580 B
TypeScript

import sql from "~/server/components/postgres";
export default defineEventHandler(async (event) => {
const body = await readBody(event);
/*
const userToken = getCookie(event, "token");
if (!userToken) {
return {
error: "ERR_NOT_ALLOWED",
};
}
const checkUserToken = await sql`
select * from usertokens
where token=${userToken}
`;
if (checkUserToken.length === 0) {
return {
error: "ERR_NOT_ALLOWED",
};
}
if (request_change === "groq_api_key") {
const updateListing = await sql``;
}*/
return { body: body };
});