Skip to content

Commit

Permalink
fix: add check to application (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmagur1203 authored Mar 15, 2023
1 parent a026b80 commit 9b7b719
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/server/src/application/application.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit 9b7b719

Please sign in to comment.