Skip to content

Commit

Permalink
fix: ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
FinleyGe committed Sep 12, 2024
1 parent e063a05 commit 320e67a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import {
Flex,
Box,
Grid,
ModalBody,
InputGroup,
InputLeftElement,
Input,
Checkbox,
ModalFooter,
Button,
useToast
Button
} from '@chakra-ui/react';
import MyModal from '@fastgpt/web/components/common/MyModal';
import MyIcon from '@fastgpt/web/components/common/Icon';
Expand Down Expand Up @@ -67,7 +65,7 @@ function AddMemberModal({ onClose }: AddModalPropsType) {
const { mutate: onConfirm, isLoading: isUpdating } = useRequest({
mutationFn: () => {
return onUpdateCollaborators({
tmbIds: selectedMemberIdList,
members: selectedMemberIdList,
permission: selectedPermission
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type MemberManagerInputPropsType = {
permission: Permission;
onGetCollaboratorList: () => Promise<CollaboratorItemType[]>;
permissionList: PermissionListType;
onUpdateCollaborators: (props: UpdateClbPermissionProps) => any;
onUpdateCollaborators: (props: any) => any;
onDelOneCollaborator: (tmbId: string) => any;
refreshDeps?: any[];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const TeamModalContextProvider = ({ children }: { children: ReactNode })
permissionList={TeamPermissionList}
onGetCollaboratorList={onGetClbList}
onUpdateCollaborators={onUpdatePer}
onDelOneCollaborator={delMemberPermission}
onDelOneCollaborator={(tmbId) => delMemberPermission({ tmbId })}
>
{() => (
<>
Expand Down
15 changes: 10 additions & 5 deletions projects/app/src/pages/app/detail/components/InfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import {
Input,
Textarea,
ModalFooter,
ModalBody,
useDisclosure
ModalBody
} from '@chakra-ui/react';
import { useForm } from 'react-hook-form';
import { AppSchema } from '@fastgpt/global/core/app/type.d';
Expand Down Expand Up @@ -39,6 +38,7 @@ import { UpdateClbPermissionProps } from '@fastgpt/global/support/permission/col
import { resumeInheritPer } from '@/web/core/app/api';
import { useI18n } from '@/web/context/I18n';
import ResumeInherit from '@/components/support/permission/ResumeInheritText';
import { PermissionValueType } from '@fastgpt/global/support/permission/type';

const InfoModal = ({ onClose }: { onClose: () => void }) => {
const { t } = useTranslation();
Expand All @@ -61,7 +61,6 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
defaultValues: appDetail
});
const avatar = getValues('avatar');
const name = getValues('name');

// submit config
const { runAsync: saveSubmitSuccess, loading: btnLoading } = useRequest2(
Expand Down Expand Up @@ -129,9 +128,15 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
[setValue, t, toast]
);

const onUpdateCollaborators = async ({ tmbIds, permission }: UpdateClbPermissionProps) => {
const onUpdateCollaborators = async ({
members,
permission
}: {
members: string[];
permission: PermissionValueType;
}) => {
await postUpdateAppCollaborators({
tmbIds,
members,
permission,
appId: appDetail._id
});
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/app/list/components/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ const ListItem = () => {
permission: number;
}) => {
return postUpdateAppCollaborators({
tmbIds,
members: tmbIds,
permission,
appId: editPerApp._id
});
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/app/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const MyApps = () => {
permission: number;
}) => {
return postUpdateAppCollaborators({
tmbIds,
members: tmbIds,
permission,
appId: folderDetail._id
});
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/dataset/list/component/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ function List() {
permission: number;
}) => {
return postUpdateDatasetCollaborators({
tmbIds,
members: tmbIds,
permission,
datasetId: editPerDataset._id
});
Expand Down
13 changes: 2 additions & 11 deletions projects/app/src/pages/dataset/list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import React, { useCallback, useMemo, useState } from 'react';
import {
Box,
Flex,
Image,
Button,
useDisclosure,
InputGroup,
InputLeftElement,
Input
} from '@chakra-ui/react';
import { Box, Flex, Button, InputGroup, InputLeftElement, Input } from '@chakra-ui/react';
import { useRouter } from 'next/router';
import { useTranslation } from 'next-i18next';
import { serviceSideProps } from '@/web/common/utils/i18n';
Expand Down Expand Up @@ -256,7 +247,7 @@ const Dataset = () => {
permission: number;
}) => {
return postUpdateDatasetCollaborators({
tmbIds,
members: tmbIds,
permission,
datasetId: folderDetail._id
});
Expand Down

0 comments on commit 320e67a

Please sign in to comment.