fix logic

This commit is contained in:
2023-02-28 08:51:37 +10:00
parent cc38a45fd0
commit ad3e6e59f2

View File

@@ -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;
}
}; };
/** /**