Weave roles into groups

This commit is contained in:
Tuan Dang
2024-03-19 11:34:28 -07:00
parent d8d63ecaec
commit 2a134b9dc2
10 changed files with 132 additions and 50 deletions
+6
View File
@@ -1,3 +1,9 @@
import { TOrgRole } from "../roles/types";
export type TGroupOrgMembership = TGroup & {
customRole?: TOrgRole;
}
export type TGroup = {
id: string;
name: string;
@@ -2,7 +2,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { TGroup } from "../groups/types";
import { TGroupOrgMembership } from "../groups/types";
import { IdentityMembershipOrg } from "../identities/types";
import {
BillingDetails,
@@ -412,7 +412,7 @@ export const useGetOrganizationGroups = (organizationId: string) => {
queryFn: async () => {
const {
data: { groups }
} = await apiRequest.get<{ groups: TGroup[] }>(`/api/v1/organization/${organizationId}/groups`);
} = await apiRequest.get<{ groups: TGroupOrgMembership[] }>(`/api/v1/organization/${organizationId}/groups`);
return groups;
}