From d6e9d3e1f28de309632e096a6d188ac1dd2d5dd2 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Tue, 2 Nov 2021 09:49:25 -0700 Subject: [PATCH] Fixed saving providers issue --- ui/src/app/metadata/editor/MetadataEditor.js | 4 ++-- ui/src/app/metadata/hooks/api.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/app/metadata/editor/MetadataEditor.js b/ui/src/app/metadata/editor/MetadataEditor.js index fac1c1fa7..2adc5b273 100644 --- a/ui/src/app/metadata/editor/MetadataEditor.js +++ b/ui/src/app/metadata/editor/MetadataEditor.js @@ -51,8 +51,8 @@ export function MetadataEditor ({ restore, current, reload }) { .then(() => { gotoDetail({ refresh: true }); }) - .catch((err) => { - notificationDispatch(createNotificationAction(`Updated data with latest changes`, NotificationTypes.INFO)) + .catch((err, notification) => { + notificationDispatch(notification || createNotificationAction(`${err.errorCode} - ${translator(err.errorMessage)}`, NotificationTypes.ERROR)); }); }; diff --git a/ui/src/app/metadata/hooks/api.js b/ui/src/app/metadata/hooks/api.js index 9c2d2f90c..d5add90a1 100644 --- a/ui/src/app/metadata/hooks/api.js +++ b/ui/src/app/metadata/hooks/api.js @@ -1,6 +1,7 @@ import useFetch from 'use-http'; import API_BASE_PATH from '../../App.constant'; +import { createNotificationAction, NotificationTypes } from '../../notifications/hoc/Notifications'; import { useContentionDispatcher, openContentionModalAction } from '../contention/ContentionContext'; import {MetadataFilterTypes} from '../domain/filter'; @@ -113,7 +114,7 @@ export function useMetadataUpdater (path, current, cancel) { resolve(await update(p, resolution)); }, (err) => { cancel && cancel(); - reject(err); + reject(err, createNotificationAction(`Updated data with latest changes`, NotificationTypes.INFO)); })); }); }