From 9c658cef2638f4aa23ba7f6b1861057c3bb8f714 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Mon, 6 May 2024 09:12:24 +0200 Subject: [PATCH] fix: validation on profile page --- frontend/src/components/modals/AvatarChangeModal.vue | 2 ++ frontend/src/pages/auth/settings/profile.vue | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/modals/AvatarChangeModal.vue b/frontend/src/components/modals/AvatarChangeModal.vue index 102e372d4..2eae681e1 100644 --- a/frontend/src/components/modals/AvatarChangeModal.vue +++ b/frontend/src/components/modals/AvatarChangeModal.vue @@ -56,6 +56,7 @@ const props = defineProps<{ csrfToken?: string; }>(); +const v = useVuelidate({ $stopPropagation: true }); const selectedFile = ref(); const cropperInput = ref(); const cropperResult = ref(); @@ -105,6 +106,7 @@ function changeImage({ canvas }: CropperResult) { } async function save() { + if (!(await v.value.$validate())) return; const form = new FormData(); form.append("avatar", cropperResult.value); if (props.csrfToken) { diff --git a/frontend/src/pages/auth/settings/profile.vue b/frontend/src/pages/auth/settings/profile.vue index 058a00e96..be213357b 100644 --- a/frontend/src/pages/auth/settings/profile.vue +++ b/frontend/src/pages/auth/settings/profile.vue @@ -68,7 +68,8 @@ async function saveProfile() {
{{ linkTypes.find((e) => e.value === link[0])?.text }}
- + +