mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 07:41:02 +08:00
Add delete account.
This commit is contained in:
parent
629d033702
commit
bd3a81dfbc
@ -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 },
|
||||
|
6
server/api/user/sendUserChanges.delete.ts
Normal file
6
server/api/user/sendUserChanges.delete.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const userToken = getCookie(event, "token");
|
||||
return {
|
||||
token: userToken,
|
||||
};
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user