Skip to content

Commit

Permalink
fix: Create Plan +- 30 여유
Browse files Browse the repository at this point in the history
  • Loading branch information
suk-6 committed Jul 17, 2024
1 parent 9479ac7 commit 7498bda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/plan/plan.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class PlanService {
}

async createPlan({ id }: User, dto: CreatePlanDTO) {
if (DateTime.fromISO(dto.date) < DateTime.now())
if (Math.abs(DateTime.fromISO(dto.date).diffNow('minutes').minutes) <= 30)
throw new HttpException('Invalid date', HttpStatus.BAD_REQUEST);

const user = await this.prisma.user.findUnique({
Expand Down

0 comments on commit 7498bda

Please sign in to comment.