Skip to content

Commit

Permalink
[FIX] 고민생성하기 response에 subtitles 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
leGit-y committed Jan 2, 2024
1 parent f281864 commit 2fcc106
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/service/worryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ const postWorry =async (worryCreateDTO: worryCreateDTO) => {
updatedAt: date,
deadlineDate: deadlineDate
}
// console.log(worryCreateDAO)

const worry = await worryRepository.createWorry(worryCreateDAO);
if (!worry) {
throw new ClientException(rm.CREATE_WORRY_FAIL);
}

const template = await templateRepository.findTemplateById(worry.template_id);
if (!template) {
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,
subtitles: template.subtitles,
answers: worry.answers,
createdAt: moment(worry.created_at).utc().utcOffset(9).format('YYYY-MM-DD'),
deadline: "데드라인이 없습니다.",
Expand Down

0 comments on commit 2fcc106

Please sign in to comment.