chore: criticism pagination
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { BadRequestException, Injectable, Logger } from "@nestjs/common";
|
||||
import { BadRequestException, Injectable } from "@nestjs/common";
|
||||
import slugify from "slugify";
|
||||
import { In, Not } from "typeorm";
|
||||
|
||||
@@ -31,7 +31,6 @@ export class UsersService {
|
||||
name: true,
|
||||
},
|
||||
};
|
||||
private logger = new Logger(UsersService.name);
|
||||
constructor(
|
||||
private userRepository: UserRepository,
|
||||
private roleRepository: RoleRepository,
|
||||
@@ -40,8 +39,15 @@ export class UsersService {
|
||||
|
||||
/************************************************************ */
|
||||
|
||||
async findOneById(id: string) {
|
||||
const user = await this.userRepository.findOneBy({ id });
|
||||
if (!user) throw new BadRequestException(UserMessage.USER_NOT_FOUND);
|
||||
return { user };
|
||||
}
|
||||
|
||||
/************************************************************ */
|
||||
|
||||
async getMe(userId: string) {
|
||||
this.logger.debug("sss");
|
||||
const user = await this.userRepository.findOne({ where: { id: userId }, select: this.userSelect });
|
||||
if (!user) throw new BadRequestException(UserMessage.USER_NOT_FOUND);
|
||||
return { user };
|
||||
|
||||
Reference in New Issue
Block a user