This commit is contained in:
Archer
2024-06-12 15:17:21 +08:00
committed by GitHub
parent bc6864c3dc
commit d0085a23e6
61 changed files with 558 additions and 348 deletions

View File

@@ -26,12 +26,14 @@ import MyBox from '@fastgpt/web/components/common/MyBox';
import { ChevronDownIcon } from '@chakra-ui/icons';
import Avatar from '@/components/Avatar';
import { useRequest } from '@fastgpt/web/hooks/useRequest';
import { useTranslation } from 'next-i18next';
export type AddModalPropsType = {
onClose: () => void;
};
function AddMemberModal({ onClose }: AddModalPropsType) {
const { t } = useTranslation();
const { userInfo } = useUserStore();
const { permissionList, collaboratorList, onUpdateCollaborators, getPerLabelList } =
@@ -63,9 +65,12 @@ function AddMemberModal({ onClose }: AddModalPropsType) {
const { mutate: onConfirm, isLoading: isUpdating } = useRequest({
mutationFn: () => {
return onUpdateCollaborators(selectedMemberIdList, selectedPermission);
return onUpdateCollaborators({
tmbIds: selectedMemberIdList,
permission: selectedPermission
});
},
successToast: '添加成功',
successToast: t('common.Add Success'),
errorToast: 'Error',
onSuccess() {
onClose();