Skip to content

Commit

Permalink
refactor(#316): modify entity/table name
Browse files Browse the repository at this point in the history
  • Loading branch information
hobiJeong committed Mar 7, 2024
1 parent de1e423 commit 01fd63b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/users/repositories/user-badge.repository.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Injectable } from '@nestjs/common';
import { Badge } from '@src/entities/Badge';
import { UserBadge } from '@src/entities/UserBadge';
import { EntityManager } from 'typeorm';
import { BadgeList } from '@src/common/entity/badge.entity';
import { UserBadge } from '@src/users/entities/user-badge.entity';

@Injectable()
export class UserBadgeRepository {
constructor(private readonly entityManager: EntityManager) {}

async getUserBadge(userId: number) {
async getUserBadges(userId: number) {
return await this.entityManager.find(UserBadge, { where: { userId } });
}

Expand All @@ -17,8 +17,8 @@ export class UserBadgeRepository {
});
}

async getBadgeList() {
return await this.entityManager.find(BadgeList);
async getBadges() {
return await this.entityManager.find(Badge);
}

async createNewBadges(newBadges: UserBadge[]): Promise<UserBadge[]> {
Expand Down
2 changes: 1 addition & 1 deletion src/users/services/user-badge.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class UserBadgeService {
);

// 3.뱃지 리스트 DB 정보 불러오기
const badgeList = await this.userBadgeRepository.getBadgeList();
const badgeList = await this.userBadgeRepository.getBadges();
const newBadges = [];

//아래 switch 문 각자의 역할별로 나누기
Expand Down

0 comments on commit 01fd63b

Please sign in to comment.