mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 08:25:07 +00:00
fix: group (#4330)
This commit is contained in:
@@ -2,7 +2,6 @@ import { Input, HStack, ModalBody, Button, ModalFooter } from '@chakra-ui/react'
|
|||||||
import MyModal from '@fastgpt/web/components/common/MyModal';
|
import MyModal from '@fastgpt/web/components/common/MyModal';
|
||||||
import Avatar from '@fastgpt/web/components/common/Avatar';
|
import Avatar from '@fastgpt/web/components/common/Avatar';
|
||||||
import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
|
import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
|
||||||
|
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
|
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
|
||||||
|
@@ -42,12 +42,10 @@ export type GroupFormType = {
|
|||||||
// 3. Owner can add/remove admins
|
// 3. Owner can add/remove admins
|
||||||
function GroupEditModal({
|
function GroupEditModal({
|
||||||
onClose,
|
onClose,
|
||||||
editGroupId,
|
|
||||||
group,
|
group,
|
||||||
onSuccess
|
onSuccess
|
||||||
}: {
|
}: {
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
editGroupId?: string;
|
|
||||||
group: MemberGroupListItemType<true>;
|
group: MemberGroupListItemType<true>;
|
||||||
onSuccess: () => void;
|
onSuccess: () => void;
|
||||||
}) {
|
}) {
|
||||||
@@ -61,10 +59,15 @@ function GroupEditModal({
|
|||||||
|
|
||||||
const selectedMembersRef = useRef<HTMLDivElement>(null);
|
const selectedMembersRef = useRef<HTMLDivElement>(null);
|
||||||
const [members, setMembers] = useState<GroupMemberItemType[]>([]);
|
const [members, setMembers] = useState<GroupMemberItemType[]>([]);
|
||||||
|
const editGroupId = useMemo(() => {
|
||||||
|
return group?._id;
|
||||||
|
}, [group]);
|
||||||
|
|
||||||
useMount(async () => {
|
useMount(async () => {
|
||||||
|
console.log('aaaaaa');
|
||||||
if (editGroupId) {
|
if (editGroupId) {
|
||||||
const data = await getGroupMembers(editGroupId);
|
const data = await getGroupMembers(editGroupId);
|
||||||
|
console.log(data);
|
||||||
setMembers(data);
|
setMembers(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user