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
*/
const handleSubmit = async () => {
dialogLoading.value = true;
try {
dialogLoading.value = true;
api.put({
url: "/users/{id}",
params: {
id: userStore.id,
},
body: {
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;
await api.put({
url: "/users/{id}",
params: {
id: userStore.id,
},
body: {
password: form.controls.password.value,
},
});
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;
}
};
/**