mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-09 12:16:36 +00:00
Add support for menu children and moved invitations under users
This commit is contained in:
@@ -20,7 +20,7 @@ import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
export type InvitationRow = {
|
||||
id: string;
|
||||
email: string;
|
||||
expiresAt: string; // ISO string or timestamp
|
||||
expiresAt: string;
|
||||
role: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -28,16 +28,20 @@ export default async function InvitationsPage(props: InvitationsPageProps) {
|
||||
roleId: string;
|
||||
roleName?: string;
|
||||
}[] = [];
|
||||
let hasInvitations = false;
|
||||
|
||||
const res = await internal
|
||||
.get<
|
||||
AxiosResponse<{
|
||||
invitations: typeof invitations;
|
||||
pagination: { total: number };
|
||||
}>
|
||||
>(`/org/${params.orgId}/invitations`, await authCookieHeader())
|
||||
.catch((e) => {});
|
||||
|
||||
if (res && res.status === 200) {
|
||||
invitations = res.data.data.invitations;
|
||||
hasInvitations = res.data.data.pagination.total > 0;
|
||||
}
|
||||
|
||||
let org: GetOrgResponse | null = null;
|
||||
@@ -61,13 +65,13 @@ export default async function InvitationsPage(props: InvitationsPageProps) {
|
||||
id: invite.inviteId,
|
||||
email: invite.email,
|
||||
expiresAt: new Date(Number(invite.expiresAt)).toISOString(),
|
||||
role: invite.roleName || "Unknown Role" // Use roleName if available
|
||||
role: invite.roleName || "Unknown Role"
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<AccessPageHeaderAndNav>
|
||||
<AccessPageHeaderAndNav hasInvitations={hasInvitations}>
|
||||
<UserProvider user={user!}>
|
||||
<OrgProvider org={org}>
|
||||
<InvitationsTable invitations={invitationRows} />
|
||||
|
||||
Reference in New Issue
Block a user