From 9b7b719b5d6791d7ac1832ba5cb9f566c97140f9 Mon Sep 17 00:00:00 2001 From: rmagur1203 Date: Wed, 15 Mar 2023 19:10:27 +0900 Subject: [PATCH] fix: add check to application (#21) --- packages/server/src/application/application.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/server/src/application/application.service.ts b/packages/server/src/application/application.service.ts index da72a5b..ccc2055 100644 --- a/packages/server/src/application/application.service.ts +++ b/packages/server/src/application/application.service.ts @@ -19,6 +19,12 @@ export class ApplicationService { ) {} async create(user: Express.User, createApplicationDto: CreateApplicationDto) { + const app = await this.applicationRepository.findOneBy({ + email: user.email, + club: { id: createApplicationDto.clubid }, + }); + if (app) + throw new HttpException('이미 지원했습니다.', HttpStatus.BAD_REQUEST); const apps = await this.applicationRepository.countBy({ email: user.email, });