Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add nullsafe chaining to dataSubmissionsListView #202

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/content/dataSubmissions/DataSubmissionsListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const ListingView: FC = () => {

// Only org owners/submitters with organizations assigned can create data submissions
const orgOwnerOrSubmitter = (user?.role === "Organization Owner" || user?.role === "Submitter");
const hasOrganizationAssigned = (user?.organization !== null && user.organization.orgID !== null);
const hasOrganizationAssigned = (user?.organization !== null && user?.organization?.orgID !== null);
const shouldHaveAllFilter = (user?.role === "Admin" || user?.role === "Federal Lead" || user?.role === "Data Curator" || user?.role === "Data Commons POC");
const [page, setPage] = useState<number>(0);
const [perPage, setPerPage] = useState<number>(10);
Expand Down Expand Up @@ -304,7 +304,7 @@ const ListingView: FC = () => {
offset: page * perPage,
sortDirection: order.toUpperCase(),
orderBy: orderBy.field,
organization: (organizationFilter !== "All" ? allOrganizations?.listOrganizations?.find((org) => org.name === organizationFilter)._id : "All"),
organization: (organizationFilter !== "All" ? allOrganizations?.listOrganizations?.find((org) => org.name === organizationFilter)?._id : "All"),
status: statusFilter,
},
context: { clientName: 'backend' },
Expand Down