Skip to content

Commit

Permalink
addressed PR comments and added triggerBulkCancel in node SDK to canc…
Browse files Browse the repository at this point in the history
…el events in bulk
  • Loading branch information
hiteshwadhwani committed Aug 11, 2024
1 parent 6f9388b commit 8a4abc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/app/events/events.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class EventsController {
@ThrottlerCost(ApiRateLimitCostEnum.BULK)
@Post('/trigger/bulk-cancel')
@ApiOkResponse({
type: TriggerBulkCancelResponseDto,
type: [TriggerBulkCancelResponseDto],
})
@ApiOperation({
summary: 'Bulk Cancel triggered event',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ProcessBulkCancelCommand } from './process-bulk-cancel.command';
export class ProcessBulkCancel {
constructor(private cancelDelayed: CancelDelayed) {}

async execute(command: ProcessBulkCancelCommand) {
async execute(command: ProcessBulkCancelCommand): Promise<TriggerBulkCancelResponseDto[]> {
const results: TriggerBulkCancelResponseDto[] = [];

for (const transactionId of command.transactionIds) {
Expand Down
6 changes: 6 additions & 0 deletions packages/node/src/lib/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@ export class Events extends WithHttp implements IEvents {
async cancel(transactionId: string) {
return await this.http.delete(`/events/trigger/${transactionId}`);
}

async triggerBulkCancel(transactionIds: string[]) {
return await this.http.post(`/events/trigger/bulk-cancel`, {
transactionIds,
});
}
}

0 comments on commit 8a4abc7

Please sign in to comment.