Add delete account.
Some checks are pending
Build and Push Docker Image / build-and-push (push) Waiting to run

This commit is contained in:
yuanhau 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;
isLoggedIn.value = true;
});
const setFirstName = async () => {
const staticFirstName = "";
};
const emit = defineEmits(["windowopener"]);
@ -98,23 +95,12 @@ const confirmDelete = async () => {
showDeleteDialog.value = false;
};
const apiKey = customApiKey.value;
try {
const sendApi = await fetch("/api/ai/loadCustomGroqApi", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
apiKey: apiKey,
}),
const deleteAccount = async () => {
const req = await fetch("/api/user/sendUserChanges", {
method: "DELETE",
});
const data = await sendApi.json();
if (data.error) {
}
} catch (e) {
console.log(e);
}
};
const submitChangeAction = async (action: string) => {
const actions = [
{ name: "NAME", sendValue: enterFirstName.value },

View file

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