Skip to content

Commit

Permalink
Handle validation errors for waiting list
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed Sep 3, 2024
1 parent cc04e5a commit 2d78da5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@ const signUp = async () => {
isLoading.value = true;
loginError.value = '';
const { data }: BooleanResponse = await call('waiting-list/join').post({
const { data, error }: BooleanResponse = await call('waiting-list/join').post({
email: email.value,
}).json();
if (error?.value) {
// Handle error
loginError.value = (data?.value as Exception)?.detail[0]?.msg;
isLoading.value = false;
return;
}
if (!data.value) {
loginError.value = t('waitingList.signUpAlreadyExists');
Expand Down

0 comments on commit 2d78da5

Please sign in to comment.