add: relation

This commit is contained in:
ilham 2021-12-10 01:37:39 +07:00
parent 77d9a95d8a
commit 1e0be3dc48
3 changed files with 2 additions and 2 deletions

View File

@ -46,6 +46,7 @@ export class ProductService {
findAll(page) {
return this.productRepository.findAndCount({
skip: page * 10,
relations: ['subCategories'],
take: 10,
order: {
version: 'DESC',

View File

@ -48,7 +48,7 @@ export class UsersController {
@Get('find-by-supperior')
async findBySuperrior(@Request() req, @Query('page') page: number) {
return {
data: await this.usersService.findBySuperrior(req.user.id, page),
data: await this.usersService.findBySuperrior(req.user.userId, page),
statusCode: HttpStatus.OK,
message: 'success',
};

View File

@ -114,7 +114,6 @@ export class UsersService {
where: {
superior: superriorId,
},
relations: ['roles'],
order: {
updatedAt: 'DESC',
},