Skip to content

Commit

Permalink
Fix how tableBody is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbay-bluetiger committed Jan 29, 2025
1 parent fff97ea commit 9fd358b
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions services/ui-src/src/components/pages/Dashboard/DashboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,23 @@ export const getStatus = (
}
return status;
};

const tableBody = (body: TableContentShape, isAdmin: boolean) => {
var tableContent = body;
if (!isAdmin) {
tableContent.headRow = tableContent.headRow!.filter((e) => e !== "#");
return tableContent;
} else {
tableContent.headRow = tableContent.headRow!.filter(
(e) => e !== "Due date" && e !== "Target populations"
const tableContent = { ...body };

if (!tableContent.headRow) {
return body;
}

if (isAdmin) {
tableContent.headRow = tableContent.headRow.filter(
(e) => !["Due date", "Target populations"].includes(e)
);
} else {
tableContent.headRow = tableContent.headRow.filter((e) => e !== "#");
}
return body;

return tableContent;
};

const EditReportButton = ({
Expand Down

0 comments on commit 9fd358b

Please sign in to comment.