Skip to content

Commit

Permalink
Modify getOrgsURL based on user type to filter in frontend/src/compon…
Browse files Browse the repository at this point in the history
…ents/OrganizationList/OrganizationList.tsx
  • Loading branch information
nickviola committed Mar 13, 2024
1 parent 2197a69 commit 8863f4a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export const OrganizationList: React.FC<{
const [organizations, setOrganizations] = useState<Organization[]>([]);
const [dialogOpen, setDialogOpen] = useState(false);
const history = useHistory();
const getOrgsURL = `/v2/organizations/`;
const regionId = user?.regionId;
let getOrgsURL: any;

if (user?.userType == 'regionalAdmin') {
getOrgsURL = `/organizations/regionId/${regionId}`;
} else {
getOrgsURL = `/v2/organizations/`;
}

const orgCols: GridColDef[] = [
{ field: 'name', headerName: 'Organization', minWidth: 100, flex: 2 },
Expand Down

0 comments on commit 8863f4a

Please sign in to comment.