mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Add delete account.
Some checks are pending
Build and Push Docker Image / build-and-push (push) Waiting to run
Some checks are pending
Build and Push Docker Image / build-and-push (push) Waiting to run
This commit is contained in:
parent
629d033702
commit
bd3a81dfbc
2 changed files with 11 additions and 19 deletions
|
@ -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 },
|
||||||
|
|
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…
Add table
Add a link
Reference in a new issue