mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
add error notifications to importer
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
import axios from 'axios';
|
||||
|
||||
export type NotificationType = 'success' | 'error';
|
||||
|
||||
export const useNotificationsStore = defineStore('notifications', () => {
|
||||
@@ -50,9 +51,7 @@ export const useNotificationsStore = defineStore('notifications', () => {
|
||||
if (axios.isAxiosError(error)) {
|
||||
if (
|
||||
error?.response?.status === 403 ||
|
||||
(error?.response?.status === 400 &&
|
||||
error?.response?.data?.error === true &&
|
||||
error?.response?.data?.errorMessage !== undefined)
|
||||
error?.response?.status === 400
|
||||
) {
|
||||
addNotification(
|
||||
'error',
|
||||
|
||||
Reference in New Issue
Block a user