♻️ (notif) add queue notif service to lazy load notif lib

This commit is contained in:
Julien Calixte
2020-04-11 00:53:27 +02:00
parent 8a76042625
commit b79569102d
19 changed files with 1280 additions and 1012 deletions

View File

@@ -240,7 +240,7 @@ import accountService from '@/services/AccountService'
import exchangeService from '@/services/ExchangeService'
import transactionService from '@/services/TransactionService'
import formatDate from '@/utils/format-date'
import notif from '@/utils/notif'
import queueNotifService from '@/services/QueueNotifService'
import { money } from '@/utils/filters'
import { confirmation, alertMessage, findContrastColor } from '@/utils'
import ILocation from '@/models/ILocation'
@@ -437,21 +437,21 @@ export default class TransactionCreate extends Vue {
(!this.currency && !this.date && this.payFor.length === 0)
) {
if (this.amount === 0) {
notif.error('Le montant doit être supérieur à 0.')
queueNotifService.error('Le montant doit être supérieur à 0.')
} else {
notif.error('Tous les champs sont requis.')
queueNotifService.error('Tous les champs sont requis.')
}
return false
}
if (isNaN(this.amount) || this.amount > this.maxAmount) {
const maxAmount = money(this.maxAmount, this.currency)
notif.error(
queueNotifService.error(
`Veuillez saisir un montant numérique inférieur à ${maxAmount}.`
)
return false
}
if (this.amount < 0) {
notif.error('Le montant doit être supérieur à 0.')
queueNotifService.error('Le montant doit être supérieur à 0.')
return false
}
return true