From b92d31b0c1530fb1aca839362e2098ee7ff02c6d Mon Sep 17 00:00:00 2001 From: Seok93 Date: Fri, 4 Oct 2024 17:51:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20=EC=9D=BC=EC=A0=95=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20&=20=EC=83=81=ED=83=9C=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EC=8B=9C=20sortOrder=EB=A5=BC=20=EC=9E=AC=EC=A0=95=EB=A0=AC?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/services/statusServiceHandler.ts | 5 +++++ src/mocks/services/taskServiceHandler.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/mocks/services/statusServiceHandler.ts b/src/mocks/services/statusServiceHandler.ts index 667c311e..d0e6e785 100644 --- a/src/mocks/services/statusServiceHandler.ts +++ b/src/mocks/services/statusServiceHandler.ts @@ -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)); + return new HttpResponse(null, { status: 204 }); }), ]; diff --git a/src/mocks/services/taskServiceHandler.ts b/src/mocks/services/taskServiceHandler.ts index 1af89c34..2b180fe6 100644 --- a/src/mocks/services/taskServiceHandler.ts +++ b/src/mocks/services/taskServiceHandler.ts @@ -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) { From 566e1b3b6123160a169690d149e797445b51b98e Mon Sep 17 00:00:00 2001 From: Seok93 Date: Fri, 4 Oct 2024 17:51:01 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20#182=20=EC=9D=BC=EC=A0=95=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20&=20=EC=83=81=ED=83=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EC=8B=9C=20sortOrder=EB=A5=BC=20=EC=9E=AC=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/services/statusServiceHandler.ts | 5 +++++ src/mocks/services/taskServiceHandler.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/mocks/services/statusServiceHandler.ts b/src/mocks/services/statusServiceHandler.ts index 667c311e..d0e6e785 100644 --- a/src/mocks/services/statusServiceHandler.ts +++ b/src/mocks/services/statusServiceHandler.ts @@ -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)); + return new HttpResponse(null, { status: 204 }); }), ]; diff --git a/src/mocks/services/taskServiceHandler.ts b/src/mocks/services/taskServiceHandler.ts index 1af89c34..2b180fe6 100644 --- a/src/mocks/services/taskServiceHandler.ts +++ b/src/mocks/services/taskServiceHandler.ts @@ -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) {