diff --git a/ars/src/apis/art/art.resolver.ts b/ars/src/apis/art/art.resolver.ts index 42ff90e..2860027 100644 --- a/ars/src/apis/art/art.resolver.ts +++ b/ars/src/apis/art/art.resolver.ts @@ -81,11 +81,8 @@ export class ArtResolver { // 작품id로 해당 작가의 모든 작품 조회 @Query(() => [Art]) - async fetchArtistWorks( - @Args('page') page: number, - @Args('artId') artId: string, - ) { - return await this.artService.findArtistWorks(artId, page); + async fetchArtistWorks(@Args('artId') artId: string) { + return await this.artService.findArtistWorks(artId); } @UseGuards(GqlAuthAccessGuard) @@ -115,7 +112,10 @@ export class ArtResolver { @UseGuards(GqlAuthAccessGuard) @Query(() => [Art]) - async fetchLikeArt(@CurrentUser() currentUser: ICurrentUser) { - return await this.likeArtService.find(currentUser.id); + async fetchLikeArt( + @Args('page') page: number, + @CurrentUser() currentUser: ICurrentUser, + ) { + return await this.likeArtService.find(currentUser.id, page); } } diff --git a/ars/src/apis/art/art.service.ts b/ars/src/apis/art/art.service.ts index 468e48a..c7bfe17 100644 --- a/ars/src/apis/art/art.service.ts +++ b/ars/src/apis/art/art.service.ts @@ -112,7 +112,7 @@ export class ArtService { } // 작품Id로 해당 작가 모든 작품검색 - async findArtistWorks(artId, page) { + async findArtistWorks(artId) { const art = await this.artRepository.findOne({ withDeleted: true, where: { id: artId }, @@ -120,8 +120,6 @@ export class ArtService { const user = art.user; return await this.artRepository.find({ withDeleted: true, - take: 10, - skip: 10 * (page - 1), where: { user: user }, }); } diff --git a/ars/src/apis/auth/auth.resolver.ts b/ars/src/apis/auth/auth.resolver.ts index 095dff7..d5ca5fb 100644 --- a/ars/src/apis/auth/auth.resolver.ts +++ b/ars/src/apis/auth/auth.resolver.ts @@ -43,9 +43,9 @@ export class AuthResolver { const user = await this.userService.findOne(email); if (!user) // 이메일 체크 - throw new UnprocessableEntityException(); + throw new UnprocessableEntityException('이메일이 올바르지 않습니다.'); const isAuth = await bcrypt.compare(password, user.password); - if (!isAuth) throw new UnauthorizedException(); + if (!isAuth) throw new UnauthorizedException('비밀번호가 틀렸습니다.'); this.authService.setRefreshToken({ user, res: context.res }); diff --git a/ars/src/apis/likeArt/likeArt.service.ts b/ars/src/apis/likeArt/likeArt.service.ts index eaff18e..29ba347 100644 --- a/ars/src/apis/likeArt/likeArt.service.ts +++ b/ars/src/apis/likeArt/likeArt.service.ts @@ -10,8 +10,12 @@ export class LikeArtService { private readonly likeArtRepository: Repository, ) {} - async find(userId) { - const arts = await this.likeArtRepository.find({ userId: userId }); + async find(userId, page) { + const arts = await this.likeArtRepository.find({ + take: 10, + skip: 10 * (page - 1), + where: { userId: userId }, + }); return arts.map((ele) => ele.art); } diff --git a/ars/src/apis/pointTransaction/pointTransaction.service.ts b/ars/src/apis/pointTransaction/pointTransaction.service.ts index 2a10069..1982d11 100644 --- a/ars/src/apis/pointTransaction/pointTransaction.service.ts +++ b/ars/src/apis/pointTransaction/pointTransaction.service.ts @@ -76,12 +76,7 @@ export class PointTransactionServive { }, ); // 유저 누적 포인트 업데이트 - // const updatedUser = this.userRepository.create({ - // ...user, - // point: user.point + charge_amount, - // }); - - const updatedUser = await queryRunner.manager.save({ + const updatedUser = await queryRunner.manager.save(User, { ...user, point: user.point + charge_amount, });