Add delete account.

This commit is contained in:
吳元皓 2025-06-09 22:34:42 +08:00
parent 629d033702
commit bd3a81dfbc
2 changed files with 11 additions and 19 deletions

View File

@ -38,9 +38,6 @@ onMounted(async () => {
useremail.value = res.email; useremail.value = res.email;
isLoggedIn.value = true; isLoggedIn.value = true;
}); });
const setFirstName = async () => {
const staticFirstName = "";
};
const emit = defineEmits(["windowopener"]); const emit = defineEmits(["windowopener"]);
@ -98,23 +95,12 @@ const confirmDelete = async () => {
showDeleteDialog.value = false; showDeleteDialog.value = false;
}; };
const apiKey = customApiKey.value; const deleteAccount = async () => {
try { const req = await fetch("/api/user/sendUserChanges", {
const sendApi = await fetch("/api/ai/loadCustomGroqApi", { method: "DELETE",
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
apiKey: apiKey,
}),
}); });
const data = await sendApi.json(); };
if (data.error) {
}
} catch (e) {
console.log(e);
}
const submitChangeAction = async (action: string) => { const submitChangeAction = async (action: string) => {
const actions = [ const actions = [
{ name: "NAME", sendValue: enterFirstName.value }, { name: "NAME", sendValue: enterFirstName.value },

View File

@ -0,0 +1,6 @@
export default defineEventHandler(async (event) => {
const userToken = getCookie(event, "token");
return {
token: userToken,
};
});