Skip to content

Commit

Permalink
Added changes requested by Samuel Oosterholt
Browse files Browse the repository at this point in the history
Added .catch statement to ChangePasswordcomponent api call
  • Loading branch information
CodeNamedRobin committed Dec 6, 2023
1 parent 7b795e8 commit 1af9a2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/ChangePasswordComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { useUserStore } from "@sudosos/sudosos-frontend-common";
import { useToast } from "primevue/usetoast";
import { useI18n } from "vue-i18n";
import { editPasswordSchema } from "@/utils/validation-schema";
import { handleError } from "@/utils/errorUtils";
const toast = useToast();
const userStore = useUserStore();
Expand All @@ -50,13 +51,13 @@ if(userStore.getCurrentUser.user) {
const changeUserPassword = handleSubmit(async (values) => {
if (userStore.getCurrentUser.user) {
apiService.user.updateUserLocalPassword(
userStore.getCurrentUser.user?.id, {password: values.password}).then(() => {
userStore.getCurrentUser.user?.id, { password: values.password }).then(() => {
toast.add({
severity: "success",
summary: "Success",
detail: `${t('passwordUpdated')}`,
life: 3000,
});});}});
});}).catch((err) => handleError(err, toast));}});
</script>

Expand Down

0 comments on commit 1af9a2f

Please sign in to comment.