kaori 3 лет назад
Родитель
Сommit
b2ab5ea6da
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/components/Admin/UserGroupDetail/UserGroupDetailPage.tsx

+ 2 - 2
packages/app/src/components/Admin/UserGroupDetail/UserGroupDetailPage.tsx

@@ -33,7 +33,7 @@ const UpdateParentConfirmModal = dynamic(() => import('./UpdateParentConfirmModa
 
 
 
 
 type Props = {
 type Props = {
-  userGroupId: string,
+  userGroupId?: string,
 }
 }
 
 
 export const UserGroupDetailPage = (props: Props) => {
 export const UserGroupDetailPage = (props: Props) => {
@@ -55,7 +55,7 @@ export const UserGroupDetailPage = (props: Props) => {
   const [isDeleteModalShown, setDeleteModalShown] = useState<boolean>(false);
   const [isDeleteModalShown, setDeleteModalShown] = useState<boolean>(false);
 
 
   useEffect(() => {
   useEffect(() => {
-    if (!ObjectId.isValid(currentUserGroupId) || currentUserGroup === null) {
+    if ((currentUserGroupId != null && !ObjectId.isValid(currentUserGroupId)) || currentUserGroup === null) {
       router.push('/admin/user-groups');
       router.push('/admin/user-groups');
     }
     }
   }, [currentUserGroup, currentUserGroupId, router]);
   }, [currentUserGroup, currentUserGroupId, router]);