File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ,
You can’t perform that action at this time.
0 commit comments