fix: after successfully deleted highlights, still return error codes

This commit is contained in:
Hongbo Wu 2023-10-11 14:48:44 +08:00
parent caa5969940
commit a4aeb40276

View file

@ -136,8 +136,11 @@ export const updateHighlight = async (
export const deleteHighlightById = async (highlightId: string) => {
return authTrx(async (tx) => {
const highlightRepo = tx.withRepository(highlightRepository)
const highlight = await highlightRepo.findOneByOrFail({
id: highlightId,
const highlight = await highlightRepo.findOneOrFail({
where: { id: highlightId },
relations: {
user: true,
},
})
await highlightRepo.delete(highlightId)