mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 15:40:47 +00:00
Make progress on SCIM
This commit is contained in:
@@ -17,6 +17,6 @@ export {
|
||||
useGetOrgPmtMethods,
|
||||
useGetOrgTaxIds,
|
||||
useGetOrgTrialUrl,
|
||||
useRenameOrg,
|
||||
useUpdateOrg,
|
||||
useUpdateOrgBillingDetails
|
||||
} from "./queries";
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
PlanBillingInfo,
|
||||
PmtMethod,
|
||||
ProductsTable,
|
||||
RenameOrgDTO,
|
||||
TaxID
|
||||
TaxID,
|
||||
UpdateOrgDTO
|
||||
} from "./types";
|
||||
|
||||
export const organizationKeys = {
|
||||
@@ -65,12 +65,20 @@ export const useCreateOrg = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useRenameOrg = () => {
|
||||
export const useUpdateOrg = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<{}, {}, RenameOrgDTO>({
|
||||
mutationFn: ({ newOrgName, orgId }) => {
|
||||
return apiRequest.patch(`/api/v1/organization/${orgId}/name`, { name: newOrgName });
|
||||
return useMutation<{}, {}, UpdateOrgDTO>({
|
||||
mutationFn: ({
|
||||
name,
|
||||
authEnforced,
|
||||
slug,
|
||||
orgId
|
||||
}) => {
|
||||
return apiRequest.patch(`/api/v1/organization/${orgId}`, {
|
||||
name,
|
||||
authEnforced,
|
||||
slug
|
||||
});
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(organizationKeys.getUserOrganizations);
|
||||
|
||||
@@ -3,11 +3,15 @@ export type Organization = {
|
||||
name: string;
|
||||
createAt: string;
|
||||
updatedAt: string;
|
||||
authEnforced: boolean;
|
||||
slug: string;
|
||||
};
|
||||
|
||||
export type RenameOrgDTO = {
|
||||
export type UpdateOrgDTO = {
|
||||
orgId: string;
|
||||
newOrgName: string;
|
||||
name?: string;
|
||||
authEnforced?: boolean;
|
||||
slug?: string;
|
||||
};
|
||||
|
||||
export type BillingDetails = {
|
||||
|
||||
Reference in New Issue
Block a user