Skip to content

Commit

Permalink
chore : 조회 부분만 원상복구
Browse files Browse the repository at this point in the history
* queryBuilder를 사용하는 이유가 일관성 하나밖에 없어, 일단은 원래대로 두고 추후 개선 예정.
  • Loading branch information
sk000801 committed Jan 9, 2024
1 parent 05a5033 commit bd1be69
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions server/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ export class AuthService {
) {}

async login(email: string): Promise<{ accessToken: string }> {
const user: User = await this.dataSource
.getRepository(User)
.createQueryBuilder('user')
.where('user.user_email = :email', { email })
.getOne();
const user: User = await this.userRepository.findOneBy({
user_email: email,
});

if (user) {
const payload = { user_id: user['user_id'] };
Expand Down Expand Up @@ -106,11 +104,9 @@ export class AuthService {
}

async isExistEmail(email: string): Promise<boolean> {
const user: User = await this.dataSource
.getRepository(User)
.createQueryBuilder('user')
.where('user.user_email = :email', { email })
.getOne();
const user: User = await this.userRepository.findOneBy({
user_email: email,
});

if (!user) {
return false;
Expand Down

0 comments on commit bd1be69

Please sign in to comment.