Skip to content

Commit

Permalink
Feat: #150 수행자 삭제 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Seok93 committed Sep 24, 2024
1 parent 149f178 commit 32e92de
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/modal/task/UpdateModalTask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ import { TASK_VALIDATION_RULES } from '@constants/formValidationRules';
import useAxios from '@hooks/useAxios';
import useToast from '@hooks/useToast';
import { useReadStatuses } from '@hooks/query/useStatusQuery';
import { useAddAssignee, useReadAssignees, useReadStatusTasks, useReadTaskFiles } from '@hooks/query/useTaskQuery';
import {
useAddAssignee,
useDeleteAssignee,
useReadAssignees,
useReadStatusTasks,
useReadTaskFiles,
} from '@hooks/query/useTaskQuery';
import { useReadProjectUserRoleList } from '@hooks/query/useProjectQuery';
import { findUserByProject } from '@services/projectService';

Expand Down Expand Up @@ -50,6 +56,7 @@ export default function UpdateModalTask({ project, taskId, onClose: handleClose
const { taskFileList, isTaskFileLoading } = useReadTaskFiles(projectId, taskId);

const { mutate: addAssigneeMutate } = useAddAssignee(projectId, taskId);
const { mutate: deleteAssigneeMutate } = useDeleteAssignee(projectId, taskId);

const methods = useForm<TaskInfoForm>({ mode: 'onChange' });
const {
Expand Down Expand Up @@ -87,8 +94,11 @@ export default function UpdateModalTask({ project, taskId, onClose: handleClose
clearData();
};

// ToDo: 수행자 삭제 API 작업시 추가할 것
const handleAssigneeDeleteClick = (user: SearchUser) => {};
const handleAssigneeDeleteClick = (user: SearchUser) => {
const isIncludedUser = assigneeList.find((assignee) => assignee.userId === user.userId);
if (!isIncludedUser) return toastInfo('수행자 목록에 없는 대상입니다. 확인 후 다시 시도 해주세요.');
deleteAssigneeMutate(user.userId);
};

// ToDo: 일정 파일 업로드 작업시 같이 작업할 것
const updateFiles = (newFiles: FileList) => {
Expand Down

0 comments on commit 32e92de

Please sign in to comment.