Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((res) => {
this.$router.push(`/${this.user.username}`);
UIkit.notification('User updated', {status: 'success', pos: 'bottom-center'});
})
.catch((err) => {
.catch((err) => {
UIkit.notification('Updating user failed', {status: 'danger', pos:'bottom-center'})
})
}
public static showSuccessNotification(message: string) {
UIkit.notification(message, {status: 'success'});
}
}).catch(() => this.destinationsListTable.current.setLoading(false) && UIkit.notification(i18n._(t`Cannot delete one or more destinations`), { status: 'danger' }));
}
onDestinationsTableSaveError = (data, i18n) => {
if (data) {
if (data.statusCode === 403) {
this.deauthorize();
}
switch (data.errorCode) {
case 1:
UIkit.notification(i18n._(t`Record with the entered value already exists`), { status: 'danger' });
break;
case 2:
UIkit.notification(i18n._(t`Invalid format`), { status: 'danger' });
break;
default:
UIkit.notification(i18n._(t`Could not save data`), { status: 'danger' });
}
} else {
UIkit.notification(i18n._(t`Could not save data`), { status: 'danger' });
}
}
public static showWarningNotification(message: string) {
UIkit.notification(message, {status: 'warning'});
}
public static showInfoNotification(message: string) {
UIkit.notification(message, {status: 'primary'});
}
.catch((err) => {
UIkit.notification('Updating user failed', {status: 'danger', pos: 'bottom-center'})
})
.finally(() => this.setLoading(false))
public static showDangerNotification(message: string) {
UIkit.notification(message, {status: 'danger'});
}
public static showDefaultNotification(message: string) {
UIkit.notification(message);
}