mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 02:36:38 +00:00
Add support for menu children and moved invitations under users
This commit is contained in:
@@ -19,6 +19,8 @@ export default async function RolesPage(props: RolesPageProps) {
|
||||
const params = await props.params;
|
||||
|
||||
let roles: ListRolesResponse["roles"] = [];
|
||||
let hasInvitations = false;
|
||||
|
||||
const res = await internal
|
||||
.get<
|
||||
AxiosResponse<ListRolesResponse>
|
||||
@@ -29,6 +31,21 @@ export default async function RolesPage(props: RolesPageProps) {
|
||||
roles = res.data.data.roles;
|
||||
}
|
||||
|
||||
const invitationsRes = await internal
|
||||
.get<
|
||||
AxiosResponse<{
|
||||
pagination: { total: number };
|
||||
}>
|
||||
>(
|
||||
`/org/${params.orgId}/invitations?limit=1&offset=0`,
|
||||
await authCookieHeader()
|
||||
)
|
||||
.catch((e) => {});
|
||||
|
||||
if (invitationsRes && invitationsRes.status === 200) {
|
||||
hasInvitations = invitationsRes.data.data.pagination.total > 0;
|
||||
}
|
||||
|
||||
let org: GetOrgResponse | null = null;
|
||||
const getOrg = cache(async () =>
|
||||
internal
|
||||
@@ -47,7 +64,7 @@ export default async function RolesPage(props: RolesPageProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<AccessPageHeaderAndNav>
|
||||
<AccessPageHeaderAndNav hasInvitations={hasInvitations}>
|
||||
<OrgProvider org={org}>
|
||||
<RolesTable roles={roleRows} />
|
||||
</OrgProvider>
|
||||
|
||||
Reference in New Issue
Block a user