Skip to content

Commit

Permalink
Merge pull request #444 from bcgsc/bugfix/DEVSU-2246-report-counts-mi…
Browse files Browse the repository at this point in the history
…ssing

DEVSU-2246 Report Counts Missing in Projects
  • Loading branch information
bnguyen-bcgsc authored Mar 28, 2024
2 parents 36c9fe1 + 7c1d135 commit df83ea3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/ProjectsView/columnDefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const readOnlyColDefs = [
},
{
headerName: 'Number of reports',
valueGetter: ({ data }) => data?.reports?.length,
valueGetter: ({ data }) => Number(data?.reportCount),
},
{
headerName: 'Number of users',
Expand Down
6 changes: 3 additions & 3 deletions app/views/ProjectsView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ const Projects = (): JSX.Element => {

useEffect(() => {
const getData = async () => {
const projectsResp = await api.get('/project?admin=true').request();
const projectsResp = await api.get(`/project?admin=${adminAccess}`).request();

setProjects(projectsResp);
setLoading(false);
};

getData();
}, []);
}, [adminAccess]);

const handleEditStart = (rowData) => {
setShowDialog(true);
setEditData(rowData);
};

const handleDelete = useCallback(async ({ ident }) => {
// eslint-disable-next-line no-restricted-globals
// eslint-disable-next-line no-restricted-globals, no-alert
if (confirm('Are you sure you want to remove this project?')) {
await api.del(`/project/${ident}`, {}).request();
const newProjects = projects.filter((project) => project.ident !== ident);
Expand Down

0 comments on commit df83ea3

Please sign in to comment.