Skip to content

Commit

Permalink
update register message
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun-Mountain committed Jun 14, 2023
1 parent 9a3aaea commit cff807c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
6 changes: 4 additions & 2 deletions frontend/src/components/auth/UserForm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<v-container>
<v-container>
<Alert />
</v-container>
<v-card
class="form-container"
:title="formTitle"
Expand Down Expand Up @@ -91,7 +94,7 @@ import { PropType, toRefs } from 'vue';
import { Form, Field } from 'vee-validate';
import * as Yup from 'yup';
import router from '@/router';
import { Alert } from '@/components';
import { getSubmitFn } from '@/helpers';
import { User } from "@/models/user.model";
import { useAuthStore, useUsersStore } from "@/store"
Expand Down Expand Up @@ -141,7 +144,6 @@ const onSubmit = getSubmitFn(schema, async (values: User) => {
await usersStore.updateAccount(values, authStore.currentUser.id);
} else {
await usersStore.register(values);
router.push("/login");
}
} catch (err) {
console.log(err)
Expand Down
15 changes: 1 addition & 14 deletions frontend/src/components/shared/AlertItem.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
<template>
<v-alert
v-model="alert"
border="start"
variant="tonal"
closable
close-label="Close Alert"
color="deep-purple-accent-4"
title="Closable Alert"
>
Aenean imperdiet. Quisque id odio. Cras dapibus. Pellentesque ut neque. Cras dapibus.

Vivamus consectetuer hendrerit lacus. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Curabitur blandit mollis lacus. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo.
</v-alert>
<!-- <v-alert
v-if="alert"
border="start"
variant="tonal"
Expand All @@ -22,7 +9,7 @@
:text="alert?.message"
:type="alert?.type"
:icon="alert?.icon"
/> -->
/>
</template>

<script lang="ts" setup>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/store/users.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const useUsersStore = defineStore({
const newAccount = { user };
await fetchWrapper.post(`${BASE_URL}signup`, newAccount);
alertStore.success("A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.")
router.push("/login");
} catch (err) {
alertStore.error(err);
}
Expand Down

0 comments on commit cff807c

Please sign in to comment.