fix highlights api

This commit is contained in:
Hongbo Wu 2023-09-05 17:31:50 +08:00
parent 5ed7e819e8
commit d9d71aa443
2 changed files with 2 additions and 3 deletions

View file

@ -31,7 +31,7 @@ export class Highlight {
@JoinColumn({ name: 'user_id' })
user!: User
@ManyToOne(() => LibraryItem, { onDelete: 'CASCADE' })
@ManyToOne(() => LibraryItem, { onDelete: 'CASCADE', eager: true })
@JoinColumn({ name: 'library_item_id' })
libraryItem!: LibraryItem

View file

@ -100,8 +100,7 @@ export const deleteHighlightById = async (highlightId: string) => {
throw new Error(`Highlight ${highlightId} not found`)
}
await highlightRepo.remove(highlight)
await highlightRepo.delete(highlightId)
return highlight
})
}