Skip to content

Commit efac1ae

Browse files
authored
Merge pull request #41 from TWC-codeit/swagger
fix: ์Šคํฌ๋žฉ ์ƒ์„ฑ ์ค‘ ๋‚ ์งœ ์˜ค๋ฅ˜๋กœ ์ธํ•ด ์Šคํฌ๋žฉ ์•ˆ๋˜๋Š” ๋ฌธ์ œ ์ˆ˜์ •
2 parents b0a292e + 83cd629 commit efac1ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

โ€Žsrc/domains/scrap/repository/articleRepository.jsโ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
const { prisma } = require("../../../config/db");
22

33
const createArticle = async (articleData, s3Url, keyword = "default") => {
4-
return prisma.article.create({
4+
const publishedAt = isNaN(new Date(articleData.write_time)) ? new Date() : new Date(articleData.write_time);
5+
6+
return prisma.article.create({
57
data: {
68
keyword,
79
title: articleData.title,
8-
publishedAt: new Date(articleData.write_time),
10+
publishedAt,
911
source: articleData.company,
1012
content: articleData.short_content,
1113
imageUrl: s3Url,

0 commit comments

Comments
ย (0)