From 81c70e71422b48193f22f1ebba7d88ec1249a851 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 24 Jun 2021 14:54:28 -0700 Subject: [PATCH] Fixed actions tabn --- ui/src/app/admin/container/SourcesActions.js | 14 ++------------ ui/src/app/dashboard/view/SourcesTab.js | 2 +- ui/src/app/metadata/hooks/api.js | 4 +++- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/ui/src/app/admin/container/SourcesActions.js b/ui/src/app/admin/container/SourcesActions.js index c3a8cca27..1d7316735 100644 --- a/ui/src/app/admin/container/SourcesActions.js +++ b/ui/src/app/admin/container/SourcesActions.js @@ -8,20 +8,10 @@ export function SourcesActions ({sources, reloadSources}) { const { dispatch } = React.useContext(NotificationContext); - const { put, del, response } = useMetadataEntity('source', { + const { put, response } = useMetadataEntity('source', { cachePolicy: 'no-cache' }); - async function deleteSource(id) { - await del(`/${id}`); - if (response.ok) { - dispatch(createNotificationAction( - `Metadata Source has been removed.` - )); - reloadSources(); - } - } - async function enableSource(source) { await put(`/${source.id}`, { ...source, @@ -36,6 +26,6 @@ export function SourcesActions ({sources, reloadSources}) { } return ( - + ); } \ No newline at end of file diff --git a/ui/src/app/dashboard/view/SourcesTab.js b/ui/src/app/dashboard/view/SourcesTab.js index 94305795b..852ec221a 100644 --- a/ui/src/app/dashboard/view/SourcesTab.js +++ b/ui/src/app/dashboard/view/SourcesTab.js @@ -16,7 +16,7 @@ export function SourcesTab () { }); async function loadSources() { - const sources = await get('/'); + const sources = await get(''); if (response.ok) { setSources(sources); } diff --git a/ui/src/app/metadata/hooks/api.js b/ui/src/app/metadata/hooks/api.js index 78e98d3ba..ab835e38e 100644 --- a/ui/src/app/metadata/hooks/api.js +++ b/ui/src/app/metadata/hooks/api.js @@ -24,7 +24,9 @@ export function getMetadataPath(type) { } export function useNonAdminSources() { - return useFetch(`${API_BASE_PATH}${getMetadataPath('source')}/disabledNonAdmin`); + return useFetch(`${API_BASE_PATH}${getMetadataPath('source')}/disabledNonAdmin`, { + cachePolicy: 'no-cache' + }); } export function getMetadataListPath(type) {