Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-1975 (pull request #495)
Browse files Browse the repository at this point in the history
Fixed actions tab
  • Loading branch information
rmathis committed Jun 24, 2021
2 parents cf3efb1 + 81c70e7 commit 5250647
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
14 changes: 2 additions & 12 deletions ui/src/app/admin/container/SourcesActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -36,6 +26,6 @@ export function SourcesActions ({sources, reloadSources}) {
}

return (
<SourceList entities={sources} onDelete={ deleteSource } onEnable={ enableSource } />
<SourceList entities={sources} onDelete={ reloadSources } onEnable={ enableSource } />
);
}
2 changes: 1 addition & 1 deletion ui/src/app/dashboard/view/SourcesTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function SourcesTab () {
});

async function loadSources() {
const sources = await get('/');
const sources = await get('');
if (response.ok) {
setSources(sources);
}
Expand Down
4 changes: 3 additions & 1 deletion ui/src/app/metadata/hooks/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5250647

Please sign in to comment.