Skip to content
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
6 changes: 3 additions & 3 deletions src/dtos/task.dto.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const createTaskRequestDTO = (data) => {
status: "PENDING",
subTasks: (data.subTasks || []).map(st => ({
title: st.title,
endDate: new Date(st.deadline)
endDate: st.endDate ? new Date(st.endDate) : new Date()
})),
references: data.references || []
};
Expand All @@ -21,7 +21,7 @@ export const updateTaskRequestDTO = (data) => {
type: data.type === "팀" ? "TEAM" : (data.type === "개인" ? "PERSONAL" : undefined),
subTasks: (data.subTasks || []).map(st => ({
title: st.title,
endDate: new Date(st.deadline),
endDate: st.endDate ? new Date(st.endDate) : new Date(),
status: st.status || "PENDING"
})),
references: data.references || []
Expand Down Expand Up @@ -89,7 +89,7 @@ export const taskListResponseDTO = (tasks) => {
type: task.type === "TEAM" ? "TEAM" : "INDIVIDUAL",
deadline: task.deadline.toISOString().split('T')[0].replace(/-/g, '.'),
dDay: dDay,
progressRate: task.progressRate // 서비스에서 계산된 값 사용
progressRate: task.progress // 서비스에서 계산된 값 사용
};
});
};
Expand Down
10 changes: 8 additions & 2 deletions src/repositories/task.repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ class TaskRepository {
async findAllTasks({ userId, type, folderId, sort }) {
console.log("userid:", userId);
const query = {
where: {},
where: {
members: {
some: {
userId: userId
}
}
},
include: {
folder: true,
subTasks: true,
Expand Down Expand Up @@ -98,7 +104,7 @@ class TaskRepository {

if (!sort || sort === 'PRIORITY') {
return processedTasks.sort((a, b) => a.myRank - b.myRank);
} else if (sort === 'PROGRASSRATE') {
} else if (sort === 'PROGRESSRATE') {
return processedTasks.sort((a, b) => b.progress - a.progress);
}

Expand Down