mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Search by user id
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Admin } from 'libs/database/admin.entity';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
@Injectable()
|
||||
export class AdminService {
|
||||
@@ -21,7 +21,8 @@ export class AdminService {
|
||||
try {
|
||||
this.logger.debug(`[admin.checkIsAdmin]`);
|
||||
const admins = await this.adminRepository.findOne({
|
||||
where: { user_id: id },
|
||||
relations: { user: true },
|
||||
where: { user: { id: id } },
|
||||
});
|
||||
if (!admins) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user