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 { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
import { Repository } from 'typeorm';
|
|
||||||
import { Admin } from 'libs/database/admin.entity';
|
import { Admin } from 'libs/database/admin.entity';
|
||||||
|
import { Repository } from 'typeorm';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AdminService {
|
export class AdminService {
|
||||||
@@ -21,7 +21,8 @@ export class AdminService {
|
|||||||
try {
|
try {
|
||||||
this.logger.debug(`[admin.checkIsAdmin]`);
|
this.logger.debug(`[admin.checkIsAdmin]`);
|
||||||
const admins = await this.adminRepository.findOne({
|
const admins = await this.adminRepository.findOne({
|
||||||
where: { user_id: id },
|
relations: { user: true },
|
||||||
|
where: { user: { id: id } },
|
||||||
});
|
});
|
||||||
if (!admins) {
|
if (!admins) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user