Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: WEB-2351 fixed whisp delete webhook filter issue #843

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: WEB-2351 fixed whisp delete webhook filter issue
  • Loading branch information
sairam459 committed Jul 4, 2024
commit 44ffb41506f32a92592c21082c06309c3dc1a8a1
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
Loading