feat: added enforceMfa toggle for orgs

This commit is contained in:
Sheen Capadngan
2024-10-17 03:02:26 +08:00
parent 9192c5caa2
commit bd1ed2614e
12 changed files with 119 additions and 7 deletions
@@ -82,13 +82,22 @@ export const useCreateOrg = (options: { invalidate: boolean } = { invalidate: tr
export const useUpdateOrg = () => {
const queryClient = useQueryClient();
return useMutation<{}, {}, UpdateOrgDTO>({
mutationFn: ({ name, authEnforced, scimEnabled, slug, orgId, defaultMembershipRoleSlug }) => {
mutationFn: ({
name,
authEnforced,
scimEnabled,
slug,
orgId,
defaultMembershipRoleSlug,
enforceMfa
}) => {
return apiRequest.patch(`/api/v1/organization/${orgId}`, {
name,
authEnforced,
scimEnabled,
slug,
defaultMembershipRoleSlug
defaultMembershipRoleSlug,
enforceMfa
});
},
onSuccess: () => {
@@ -11,6 +11,7 @@ export type Organization = {
scimEnabled: boolean;
slug: string;
defaultMembershipRole: string;
enforceMfa: boolean;
};
export type UpdateOrgDTO = {
@@ -20,6 +21,7 @@ export type UpdateOrgDTO = {
scimEnabled?: boolean;
slug?: string;
defaultMembershipRoleSlug?: string;
enforceMfa?: boolean;
};
export type BillingDetails = {
@@ -42,4 +42,5 @@ export type SubscriptionPlan = {
instanceUserManagement: boolean;
externalKms: boolean;
pkiEst: boolean;
enforceMfa: boolean;
};