Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
fix: Do not throw error if previousDate is in the future
Browse files Browse the repository at this point in the history
samymsa committed Jan 18, 2024
1 parent aeab16c commit 640e887
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/meetings/meetings.controller.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ import { MeetingsService } from './meetings.service';
import { CreateMeetingDto } from './dto/create-meeting.dto';
import { UpdateMeetingDto } from './dto/update-meeting.dto';
import { Attendee, Meeting } from '@prisma/client';
import { isAfter, isValid } from 'date-fns';
import { isValid } from 'date-fns';
import { MeetingWithAttendees } from './meetings.type';
import { Observable, filter, map } from 'rxjs';
import { EventEmitter2 } from '@nestjs/event-emitter';
@@ -69,10 +69,7 @@ export class MeetingsController {
);
}

if (isAfter(previousDate, new Date())) {
throw new BadRequestException('Previous date must be in the past');
}

this.logger.debug(`Now: ${new Date().toISOString()}`);
this.logger.debug(`Finding meetings before ${previousDate.toISOString()}`);

const meetings = await this.meetingsService.findAllPrevious(previousDate);

0 comments on commit 640e887

Please sign in to comment.