mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 05:13:43 +00:00
Continue ST V3 roles
This commit is contained in:
@@ -14,6 +14,7 @@ export {
|
||||
useGetOrgPlansTable,
|
||||
useGetOrgPlanTable,
|
||||
useGetOrgPmtMethods,
|
||||
useGetOrgServiceMemberships,
|
||||
useGetOrgTaxIds,
|
||||
useGetOrgTrialUrl,
|
||||
useRenameOrg,
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
import { ServiceMembershipOrg } from "../serviceTokens/types";
|
||||
import {
|
||||
BillingDetails,
|
||||
Invoice,
|
||||
@@ -15,7 +16,7 @@ import {
|
||||
TaxID
|
||||
} from "./types";
|
||||
|
||||
const organizationKeys = {
|
||||
export const organizationKeys = {
|
||||
getUserOrganizations: ["organization"] as const,
|
||||
getOrgPlanBillingInfo: (orgId: string) => [{ orgId }, "organization-plan-billing"] as const,
|
||||
getOrgPlanTable: (orgId: string) => [{ orgId }, "organization-plan-table"] as const,
|
||||
@@ -25,7 +26,8 @@ const organizationKeys = {
|
||||
getOrgPmtMethods: (orgId: string) => [{ orgId }, "organization-pmt-methods"] as const,
|
||||
getOrgTaxIds: (orgId: string) => [{ orgId }, "organization-tax-ids"] as const,
|
||||
getOrgInvoices: (orgId: string) => [{ orgId }, "organization-invoices"] as const,
|
||||
getOrgLicenses: (orgId: string) => [{ orgId }, "organization-licenses"] as const
|
||||
getOrgLicenses: (orgId: string) => [{ orgId }, "organization-licenses"] as const,
|
||||
getOrgServiceMemberships: (orgId: string) => [{ orgId }, "organization-service-memberships"] as const,
|
||||
};
|
||||
|
||||
export const fetchOrganizations = async () => {
|
||||
@@ -349,6 +351,22 @@ export const useGetOrgLicenses = (organizationId: string) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetOrgServiceMemberships = (organizationId: string) => {
|
||||
return useQuery({
|
||||
queryKey: organizationKeys.getOrgServiceMemberships(organizationId),
|
||||
queryFn: async () => {
|
||||
const {
|
||||
data: { serviceMemberships }
|
||||
} = await apiRequest.get<{ serviceMemberships: ServiceMembershipOrg[] }>(
|
||||
`/api/v2/organizations/${organizationId}/service-memberships`
|
||||
);
|
||||
|
||||
return serviceMemberships;
|
||||
},
|
||||
enabled: true
|
||||
});
|
||||
};
|
||||
|
||||
export const useDeleteOrgById = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user