Skip to content

Commit

Permalink
Fix: #253 프로젝트 팀원 삭제 핸들러 삭제 범위 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-bear98 committed Oct 31, 2024
1 parent ac3f1cd commit 78f7eee
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/mocks/services/projectServiceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,23 @@ const projectServiceHandler = [
}

try {
const statusIds = findAllProjectStatus(projectId).map((status) => status.statusId);

const taskIds: number[] = [];
statusIds.forEach((statusId) => {
const tasks = findAllTask(statusId);
tasks.forEach((task) => taskIds.push(task.taskId));
});

taskIds.forEach((taskId) => {
deleteAllTaskFileInMemory(taskId);
deleteAllTaskFile(taskId);
deleteAllTaskUser(taskId);
});
deleteProjectUser(projectId, projectCoworkerId);
} catch (error) {
console.error((error as Error).message);
return new HttpResponse('해당 유저를 찾을 수 없습니다.', { status: 404 });
return new HttpResponse('유저 삭제 중 오류가 발생했습니다.', { status: 500 });
}

return new HttpResponse(null, { status: 200 });
Expand Down

0 comments on commit 78f7eee

Please sign in to comment.