diff --git a/src/service/worryService.ts b/src/service/worryService.ts index d6c5da8..1dd8772 100644 --- a/src/service/worryService.ts +++ b/src/service/worryService.ts @@ -35,6 +35,8 @@ 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, @@ -42,12 +44,11 @@ const postWorry =async (worryCreateDTO: worryCreateDTO) => { 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;