Skip to content

Commit 9b7b719

Browse files
authored
fix: add check to application (#21)
1 parent a026b80 commit 9b7b719

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/server/src/application/application.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export class ApplicationService {
1919
) {}
2020

2121
async create(user: Express.User, createApplicationDto: CreateApplicationDto) {
22+
const app = await this.applicationRepository.findOneBy({
23+
email: user.email,
24+
club: { id: createApplicationDto.clubid },
25+
});
26+
if (app)
27+
throw new HttpException('이미 지원했습니다.', HttpStatus.BAD_REQUEST);
2228
const apps = await this.applicationRepository.countBy({
2329
email: user.email,
2430
});

0 commit comments

Comments
 (0)