Skip to content

Commit c20e48e

Browse files
committed
modify: service의 getByToken이 아닌 repo의 findQRLoginToken을 사용하도록 수정
1 parent 624be89 commit c20e48e

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/services/__test__/qr.service.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ describe('UserService 의 QRService', () => {
6666
};
6767
repo.findQRLoginToken.mockResolvedValue(mockToken);
6868

69-
const result = await service.getByToken('token');
69+
const result = await repo.findQRLoginToken('token');
7070
expect(result).toEqual(mockToken);
7171
});
7272

7373
it('토큰이 없으면 null 반환', async () => {
7474
repo.findQRLoginToken.mockResolvedValue(null);
75-
const result = await service.getByToken('token');
75+
const result = await repo.findQRLoginToken('token');
7676
expect(result).toBeNull();
7777
});
7878

7979
it('조회 중 오류 발생 시 예외 발생', async () => {
8080
repo.findQRLoginToken.mockRejectedValueOnce(new DBError('조회 실패'));
81-
await expect(service.getByToken('token')).rejects.toThrow('조회 실패');
81+
await expect(repo.findQRLoginToken('token')).rejects.toThrow('조회 실패');
8282
});
8383
});
8484

src/services/user.service.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ export class UserService {
135135
return token;
136136
}
137137

138-
async getByToken(token: string): Promise<QRLoginToken | null> {
139-
return await this.userRepo.findQRLoginToken(token);
140-
}
141-
142138
async useToken(token: string): Promise<QRLoginToken | null> {
143139
const qrToken = await this.userRepo.findQRLoginToken(token);
144140

0 commit comments

Comments
 (0)