Feat(Fix): Multi Org, Suspension, User Detail
Multi Org switch, members suspend/unsuspend status, delete account, next serial, show email in user member search
This commit is contained in:
@@ -12,7 +12,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { api, OrgPolicyResponse, UpdateOrgPolicyDto, create403Handler } from "@/lib/api";
|
||||
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { useOrganizations } from "@/hooks/useOrganizations";
|
||||
import { useOrg } from "@/contexts/OrgContext";
|
||||
|
||||
const MFA_MODE_LABELS: Record<string, { label: string; description: string }> = {
|
||||
disabled: {
|
||||
@@ -41,8 +41,8 @@ export default function PoliciesPage() {
|
||||
const navigate = useNavigate();
|
||||
const { toast } = useToast();
|
||||
const queryClient = useQueryClient();
|
||||
const [currentOrgId, setCurrentOrgId] = useState<string | null>(null);
|
||||
|
||||
const { selectedOrgId: currentOrgId } = useOrg();
|
||||
|
||||
// Local form state for unsaved changes
|
||||
const [formData, setFormData] = useState({
|
||||
mfa_policy_mode: '',
|
||||
@@ -51,15 +51,6 @@ export default function PoliciesPage() {
|
||||
});
|
||||
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
|
||||
|
||||
// Fetch organizations to get current org
|
||||
const { data: organizations, isLoading: orgsLoading } = useOrganizations();
|
||||
|
||||
useEffect(() => {
|
||||
if (organizations && organizations.length > 0) {
|
||||
setCurrentOrgId(organizations[0].id);
|
||||
}
|
||||
}, [organizations]);
|
||||
|
||||
// Fetch org policy
|
||||
const { data: policy, isLoading: policyLoading } = useQuery({
|
||||
queryKey: ['org-policy', currentOrgId],
|
||||
@@ -180,7 +171,7 @@ export default function PoliciesPage() {
|
||||
}
|
||||
};
|
||||
|
||||
if (orgsLoading || policyLoading) {
|
||||
if (policyLoading) {
|
||||
return (
|
||||
<div className="page-container">
|
||||
<div className="flex items-center justify-center py-12">
|
||||
|
||||
Reference in New Issue
Block a user