mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Update sendUserChanges to make the settings system work.
This commit is contained in:
parent
ad0f13a1a2
commit
85c3332c76
3 changed files with 23 additions and 16 deletions
|
@ -100,23 +100,24 @@ const checkValidApiKey = () => {
|
|||
const showDeleteDialog = ref(false);
|
||||
const showLogoutDialog = ref(false);
|
||||
const confirmDelete = async () => {
|
||||
showDeleteDialog.value = false;
|
||||
await deleteAccount();
|
||||
await validateUserInfo();
|
||||
showDeleteDialog.value = false;
|
||||
};
|
||||
|
||||
const deleteAccount = async () => {
|
||||
const req = await fetch("/api/user/sendUserChanges", {
|
||||
method: "DELETE",
|
||||
});
|
||||
const res = await res.json();
|
||||
const res = await req.json();
|
||||
console.log(res);
|
||||
};
|
||||
|
||||
const submitChangeAction = async (action: string) => {
|
||||
//const allowedColumns = ["firstname", "email"];
|
||||
const actions = [
|
||||
{ name: "NAME", sendValue: enterFirstName.value },
|
||||
{ name: "USER_EMAIL", sendValue: enteruseremail.value },
|
||||
{ name: "NAME", SQLSystem: "firstname", sendValue: enterFirstName.value },
|
||||
{ name: "USER_EMAIL", SQLSystem: "email", sendValue: enteruseremail.value },
|
||||
];
|
||||
|
||||
const actionMatch = actions.find((a) => a.name === action);
|
||||
|
@ -131,7 +132,7 @@ const submitChangeAction = async (action: string) => {
|
|||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
action: actionMatch.name,
|
||||
action: actionMatch.SQLSystem,
|
||||
value: actionMatch.sendValue,
|
||||
jsonValue: "",
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue