Client - handle error on api calls

This commit is contained in:
Sam
2021-08-11 21:12:20 +02:00
parent cd418c9be2
commit 7df5ea9870
14 changed files with 87 additions and 15 deletions

View File

@ -43,11 +43,12 @@
</template>
<script lang="ts">
import { defineComponent, reactive, ref } from 'vue'
import { computed, defineComponent, reactive } from 'vue'
import { useI18n } from 'vue-i18n'
import { useStore } from 'vuex'
import { IFormData } from '@/interfaces.ts'
import { USER_STORE } from '@/store/constants'
import { ROOT_STORE, USER_STORE } from '@/store/constants'
export default defineComponent({
name: 'UserForm',
@ -75,7 +76,9 @@
}
return {
errorMessage: ref(null),
errorMessage: computed(
() => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGE]
),
t,
formData,
onSubmit,