Skip to content

Commit

Permalink
Added the uuid for introspect
Browse files Browse the repository at this point in the history
  • Loading branch information
kwarnerredhat committed Dec 13, 2023
1 parent e543740 commit ecbf56b
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/Pages/ContentListTable/ContentListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,28 +246,15 @@ const ContentListTable = () => {
title: 'Trigger Snapshot',
};

const fetchDataFromAPI = async () => {
const introspectRepoForUuid = async (uuid) => {
try {
const response = await fetch('../../services/Content/ContentApi');
if (!response.ok) {
throw new Error('Failed to fetch data');
}
const data = await response.json();
console.log('Fetched data:', data);
await introspectRepository({ uuid, reset_count: false });
clearCheckedRepositories();
} catch (error) {
console.error('Error fetching data:', error);
console.error('Error introspecting repository:', error);
}
};

const someAction = {
title: 'Some Action',
onClick: () => {
fetchDataFromAPI();
},
};

return [someAction];

const deleteAction = {
title: 'Delete',
onClick: () =>
Expand Down Expand Up @@ -312,7 +299,7 @@ const ContentListTable = () => {
{
isDisabled: actionTakingPlace || rowData?.status === 'Retrying',
title: 'Introspect Now',
onClick: () => introspectRepoForUuid(rowData?.uuid).then(clearCheckedRepositories),
onClick: () => introspectRepoForUuid(rowData?.uuid),
},
{ isSeparator: true },
deleteAction,
Expand Down

0 comments on commit ecbf56b

Please sign in to comment.