This commit is contained in:
2026-03-10 11:35:02 +03:30
parent cb4c8e1901
commit ee6af69eee
2 changed files with 7 additions and 1 deletions
@@ -3,6 +3,7 @@ import { wrap } from '@mikro-orm/core';
import { EntityManager } from '@mikro-orm/postgresql'; import { EntityManager } from '@mikro-orm/postgresql';
import { UpdateAdminDto } from '../dto/update-admin.dto'; import { UpdateAdminDto } from '../dto/update-admin.dto';
import { AdminRepository } from '../repositories/admin.repository'; import { AdminRepository } from '../repositories/admin.repository';
import { CreateAdminDto } from '../dto/create-admin.dto';
@Injectable() @Injectable()
export class AdminService { export class AdminService {
@@ -15,6 +16,10 @@ export class AdminService {
return this.adminRepository.findOne({ phone }); return this.adminRepository.findOne({ phone });
} }
// async create(dto:CreateAdminDto){
// this.em.create(dto)
// }
async finAdminById( async finAdminById(
adminId: string, adminId: string,
restId: string, restId: string,
+2 -1
View File
@@ -19,7 +19,8 @@ export class BusinessService {
throw new BadRequestException() throw new BadRequestException()
} }
const business = this.em.create(Business, { ...dto, admin }) const business = this.em.create(Business, { ...dto, admin })
return this.em.persistAndFlush(business) await this.em.persistAndFlush(business)
return business
} }
findAll() { findAll() {