mirror of
				https://github.com/mokuappio/serverless-invoices.git
				synced 2025-10-28 08:21:08 -04:00 
			
		
		
		
	Fix success messages.
This commit is contained in:
		| @ -71,10 +71,10 @@ export default { | |||||||
|       this.errors.clear(); |       this.errors.clear(); | ||||||
|  |  | ||||||
|       return this.$store.dispatch('bankAccounts/updateBankAccount', props) |       return this.$store.dispatch('bankAccounts/updateBankAccount', props) | ||||||
|         .then((res) => { |         .then(() => { | ||||||
|           NotificationService.success(res.message); |           NotificationService.success('Updated'); | ||||||
|         }) |         }) | ||||||
|         .catch(err => this.errors.set(err.response.data.errors)); |         .catch(err => this.errors.set(err.errors)); | ||||||
|     }, |     }, | ||||||
|     createBankAccount() { |     createBankAccount() { | ||||||
|       this.loading = true; |       this.loading = true; | ||||||
| @ -89,7 +89,7 @@ export default { | |||||||
|           }); |           }); | ||||||
|           this.$emit('done'); |           this.$emit('done'); | ||||||
|         }) |         }) | ||||||
|         .catch(err => this.errors.set(err.response.data.errors)) |         .catch(err => this.errors.set(err.errors)) | ||||||
|         .finally(() => { |         .finally(() => { | ||||||
|           this.loading = false; |           this.loading = false; | ||||||
|         }); |         }); | ||||||
|  | |||||||
| @ -119,10 +119,10 @@ export default { | |||||||
|       this.errors.clear(); |       this.errors.clear(); | ||||||
|  |  | ||||||
|       this.$store.dispatch('clients/updateClient', props) |       this.$store.dispatch('clients/updateClient', props) | ||||||
|         .then((res) => { |         .then(() => { | ||||||
|           NotificationService.success(res.message); |           NotificationService.success('Updated'); | ||||||
|         }) |         }) | ||||||
|         .catch(err => this.errors.set(err.response.data.errors)); |         .catch(err => this.errors.set(err.errors)); | ||||||
|     }, |     }, | ||||||
|     bankAccountChanged(val) { |     bankAccountChanged(val) { | ||||||
|       this.updateProp({ |       this.updateProp({ | ||||||
| @ -143,7 +143,7 @@ export default { | |||||||
|           }); |           }); | ||||||
|           this.$emit('done'); |           this.$emit('done'); | ||||||
|         }) |         }) | ||||||
|         .catch(err => this.errors.set(err.response.data.errors)) |         .catch(err => this.errors.set(err.errors)) | ||||||
|         .finally(() => { |         .finally(() => { | ||||||
|           this.loading = false; |           this.loading = false; | ||||||
|         }); |         }); | ||||||
| @ -158,9 +158,9 @@ export default { | |||||||
|       }); |       }); | ||||||
|       if (confirmed) { |       if (confirmed) { | ||||||
|         this.$emit('done'); |         this.$emit('done'); | ||||||
|         const res = await this.$store.dispatch('clients/deleteClient', clientId); |         await this.$store.dispatch('clients/deleteClient', clientId); | ||||||
|         try { |         try { | ||||||
|           NotificationService.success(res.message); |           NotificationService.success('Deleted'); | ||||||
|         } catch (err) { |         } catch (err) { | ||||||
|           NotificationService.error(err.message); |           NotificationService.error(err.message); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -58,8 +58,8 @@ export default { | |||||||
|         contentClass: 'bg-base dp--24', |         contentClass: 'bg-base dp--24', | ||||||
|       }); |       }); | ||||||
|       if (confirmed) { |       if (confirmed) { | ||||||
|         const res = await this.$store.dispatch('invoices/deleteInvoice', this.invoice); |         await this.$store.dispatch('invoices/deleteInvoice', this.invoice); | ||||||
|         NotificationService.success(res.message); |         NotificationService.success('Deleted'); | ||||||
|         this.$router.push({ |         this.$router.push({ | ||||||
|           name: 'invoices', |           name: 'invoices', | ||||||
|         }); |         }); | ||||||
|  | |||||||
| @ -30,7 +30,8 @@ class BankAccountService { | |||||||
|     } else { |     } else { | ||||||
|       bankAccounts[index] = bankAccount; |       bankAccounts[index] = bankAccount; | ||||||
|     } |     } | ||||||
|     return storage.setItem('bank_accounts', bankAccounts); |     await storage.setItem('bank_accounts', bankAccounts); | ||||||
|  |     return bankAccount; | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
| @ -124,7 +124,8 @@ class InvoiceService { | |||||||
|     } else { |     } else { | ||||||
|       invoices[index] = invoice; |       invoices[index] = invoice; | ||||||
|     } |     } | ||||||
|     return storage.setItem('invoices', invoices); |     await storage.setItem('invoices', invoices); | ||||||
|  |     return invoice; | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user