fix logic
This commit is contained in:
@@ -61,33 +61,32 @@ const handleClickCancel = () => {
|
|||||||
* User clicks form submit button
|
* User clicks form submit button
|
||||||
*/
|
*/
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
dialogLoading.value = true;
|
try {
|
||||||
|
dialogLoading.value = true;
|
||||||
|
|
||||||
api.put({
|
await api.put({
|
||||||
url: "/users/{id}",
|
url: "/users/{id}",
|
||||||
params: {
|
params: {
|
||||||
id: userStore.id,
|
id: userStore.id,
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
password: form.controls.password.value,
|
password: form.controls.password.value,
|
||||||
},
|
},
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
const toastStore = useToastStore();
|
|
||||||
|
|
||||||
toastStore.addToast({
|
|
||||||
title: "Password Reset",
|
|
||||||
content: "Your password has been reset",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
closeDialog(false);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
form.apiErrors(error);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
dialogLoading.value = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const toastStore = useToastStore();
|
||||||
|
|
||||||
|
toastStore.addToast({
|
||||||
|
title: "Password Reset",
|
||||||
|
content: "Your password has been reset",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
closeDialog(false);
|
||||||
|
} catch (error) {
|
||||||
|
form.apiErrors(error);
|
||||||
|
} finally {
|
||||||
|
dialogLoading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user