Add lockout-preventative step in saml config setup, add update org slug section in org settings, revise navigate to org flow to account for org-level auth enforced orgs

This commit is contained in:
Tuan Dang
2024-02-06 15:51:24 -08:00
parent c1aa5c840c
commit fc7015de83
29 changed files with 409 additions and 125 deletions
+1 -1
View File
@@ -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);
+6 -2
View File
@@ -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 = {