web/satellite: add notification when credit card deleted

github issue: https://github.com/storj/storj/issues/4289

also change other notifications in CardDialog.vue to use $notify plugin

Change-Id: Ic38c39cce8ade720a8fcd9061e916978168575b8
This commit is contained in:
Cameron 2022-05-20 17:49:05 -04:00
parent 55de50eea7
commit a96c2b9733

View File

@ -12,7 +12,6 @@
import { Component, Prop, Vue } from 'vue-property-decorator';
import { PAYMENTS_ACTIONS } from '@/store/modules/payments';
import { NOTIFICATION_ACTIONS } from '@/utils/constants/actionNames';
const {
CLEAR_CARDS_SELECTION,
@ -40,7 +39,7 @@ export default class CardDialog extends Vue {
try {
await this.$store.dispatch(MAKE_CARD_DEFAULT, this.cardId);
} catch (error) {
await this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, error.message);
await this.$notify.error(error.message);
}
}
@ -50,8 +49,9 @@ export default class CardDialog extends Vue {
public async onRemoveClick(): Promise<void> {
try {
await this.$store.dispatch(REMOVE_CARD, this.cardId);
await this.$notify.success('Credit card removed');
} catch (error) {
await this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, error.message);
await this.$notify.error(error.message);
}
}
}