Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: #182 칸반 보드에서 일정 삭제 / 상태 삭제 후 순서 변경이 제대로 일어나지 않는 문제 해결 #184

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/mocks/services/statusServiceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ const statusServiceHandler = [
const statusIndex = STATUS_DUMMY.findIndex((status) => status.statusId === Number(statusId));
if (statusIndex !== -1) STATUS_DUMMY.splice(statusIndex, 1);

// 프로젝튼 상태 순서 재정렬
STATUS_DUMMY.filter((status) => status.projectId === Number(projectId))
.sort((a, b) => a.sortOrder - b.sortOrder)
.forEach((status, index) => (status.sortOrder = index + 1));
Seok93 marked this conversation as resolved.
Show resolved Hide resolved

return new HttpResponse(null, { status: 204 });
}),
];
Expand Down
5 changes: 5 additions & 0 deletions src/mocks/services/taskServiceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ const taskServiceHandler = [
const taskIndex = TASK_DUMMY.findIndex((task) => task.taskId === Number(taskId));
if (taskIndex !== -1) TASK_DUMMY.splice(taskIndex, 1);

// 프로젝트 상태에 남은 일정 순서 재정렬
TASK_DUMMY.filter((target) => target.statusId === task.statusId)
.sort((a, b) => a.sortOrder - b.sortOrder)
.forEach((task, index) => (task.sortOrder = index + 1));

// 일정의 수행자 삭제
const filteredTaskUser = TASK_USER_DUMMY.filter((taskUser) => taskUser.taskId !== Number(taskId));
if (filteredTaskUser.length !== TASK_USER_DUMMY.length) {
Expand Down