Skip to content

Commit

Permalink
Merge pull request #843 from Sanofi-IADC/feature/whisp-delete
Browse files Browse the repository at this point in the history
fix: WEB-2351 fixed whisp delete webhook filter issue
  • Loading branch information
sairam459 authored Jul 5, 2024
2 parents 012b4bc + 44ffb41 commit 41f58b9
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 41f58b9

Please sign in to comment.