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

Commit

Permalink
Merge pull request #109 from HybridPlanner/fix/previous
Browse files Browse the repository at this point in the history
Fix/previous
samymsa authored Jan 18, 2024
2 parents 463564b + 640e887 commit c99fad3
Showing 4 changed files with 9,670 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -3,3 +3,5 @@ Dockerfile
.dockerignore
node_modules
.git
prisma/database.db
prisma/database.db-journal
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -15,8 +15,9 @@ FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/package*.json .
COPY --from=builder /app/dist .
COPY --from=builder /app/node_modules .
COPY --from=builder /app/node_modules ./node_modules/
COPY --from=builder /app/prisma ./prisma

ENV NODE_ENV production

CMD [ "npm", "run", "start" ]
CMD [ "node", "main.js" ]
9,663 changes: 9,663 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

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 c99fad3

Please sign in to comment.