Skip to content

Commit

Permalink
fix: WEB-2351 fixed whisp delete webhook filter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sairam459 committed Jul 4, 2024
1 parent 5008da2 commit 44ffb41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/whisp/whisp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,14 @@ export class WhispService {
}

async delete(id: string): Promise<boolean> {
const whisp = await this.whispModel.findById(id).exec();
const { deletedCount: countOfDeletedWhisp } = await this.whispModel
.deleteOne({ _id: id })
.exec();
if (countOfDeletedWhisp <= 0) {
return false;
}
await this.eventService.triggerEvent(new Event(EventNames.WHISP_DELETED, id));
await this.eventService.triggerEvent(new Event(EventNames.WHISP_DELETED, whisp));

return true;
}
Expand Down

0 comments on commit 44ffb41

Please sign in to comment.