Skip to content

Commit 0d4d7ef

Browse files
authored
Merge pull request #405 from Quickchive/fix/remove-category-content-duplication-check
fix: 콘텐츠를 새로 저장할 때, 중복 검사 예외 처리
2 parents e098882 + 147c240 commit 0d4d7ef

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/contents/contents.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ export class ContentsService {
101101
]);
102102

103103
await this.isDuplicatedContents(
104-
content.id,
105104
[category, ...subCategories],
106105
content.link,
106+
content.id,
107107
);
108108

109109
content.category = category;
@@ -230,9 +230,9 @@ export class ContentsService {
230230
]);
231231

232232
await this.isDuplicatedContents(
233-
content.id,
234233
[category, ...subCategories],
235234
content.link,
235+
content.id,
236236
);
237237

238238
await this.contentRepository.updateOne(
@@ -483,13 +483,13 @@ export class ContentsService {
483483
}
484484

485485
private async isDuplicatedContents(
486-
id: number,
487486
categories: Category[],
488487
link: string,
488+
id?: number,
489489
) {
490490
const existingContents = await this.contentRepository.find({
491491
where: {
492-
id: Not(id),
492+
...(id && { id: Not(id) }),
493493
category: {
494494
id: In(categories.map((category) => category.id)),
495495
},

0 commit comments

Comments
 (0)