|
|
@@ -23,6 +23,14 @@ export class ChatRoleService {
|
|
|
return await paginate<ChatRole>(this.chatRoleRepository, req.page, req.search)
|
|
|
}
|
|
|
|
|
|
+ async findByPlayerName(playerName: string): Promise<ChatRole> {
|
|
|
+ const chatRole = await this.chatRoleRepository.findOneBy({ playerName: playerName })
|
|
|
+ if (!chatRole) {
|
|
|
+ throw new NotFoundException(`Associated ChatRole ${playerName} not found`)
|
|
|
+ }
|
|
|
+ return chatRole
|
|
|
+ }
|
|
|
+
|
|
|
async findMapByIds(ids: number[]): Promise<Map<number, ChatRole>> {
|
|
|
const chatRoleList = await this.chatRoleRepository.createQueryBuilder('chatRole')
|
|
|
.where({
|