Skip to content

Commit

Permalink
Merge pull request #8239 from ever-co/fix/async-await-conflict-deletion
Browse files Browse the repository at this point in the history
[Fix] async-await handling in conflict deletion to ensure proper command execution
  • Loading branch information
rahul-rocket authored Sep 23, 2024
2 parents c61f9ae + ed0f9ce commit 54d8c81
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/time-tracking/timer/timer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,11 @@ export class TimerService {

// Delete conflicts
await Promise.all(
await conflicts.flatMap((timeLog: ITimeLog) => {
conflicts.flatMap((timeLog: ITimeLog) => {
const { timeSlots = [] } = timeLog;
timeSlots.map(async (timeSlot: ITimeSlot) => {
await this.commandBus.execute(new DeleteTimeSpanCommand(times, timeLog, timeSlot));
});
return timeSlots.map((timeSlot: ITimeSlot) =>
this.commandBus.execute(new DeleteTimeSpanCommand(times, timeLog, timeSlot))
);
})
);
}
Expand Down

0 comments on commit 54d8c81

Please sign in to comment.