Skip to content

Commit

Permalink
[FIX] 고민생성하기 dDay 값 음수로 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
leGit-y committed Dec 26, 2023
1 parent 5687e7f commit 7d93660
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/service/worryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,20 @@ const postWorry =async (worryCreateDTO: worryCreateDTO) => {
throw new ClientException(rm.CREATE_WORRY_FAIL);
}

const gap = calculate_d_day(deadlineDate)

const data:any = {
worryId: worry.id,
title: worry.title,
templateId: worry.template_id,
answers: worry.answers,
createdAt: moment(worry.created_at).utc().utcOffset(9).format('YYYY-MM-DD'),
deadline: "데드라인이 없습니다.",
dDay: -888
dDay: gap
}

if(worry.deadline != null){
data.deadline = worry.deadline.toISOString().substring(0,10)
data.dDay = deadline
}

return data;
Expand Down

0 comments on commit 7d93660

Please sign in to comment.