diff --git a/src/modules/admin/providers/admin.service.ts b/src/modules/admin/providers/admin.service.ts index 18af6f5..670d401 100644 --- a/src/modules/admin/providers/admin.service.ts +++ b/src/modules/admin/providers/admin.service.ts @@ -3,6 +3,7 @@ import { wrap } from '@mikro-orm/core'; import { EntityManager } from '@mikro-orm/postgresql'; import { UpdateAdminDto } from '../dto/update-admin.dto'; import { AdminRepository } from '../repositories/admin.repository'; +import { CreateAdminDto } from '../dto/create-admin.dto'; @Injectable() export class AdminService { @@ -15,6 +16,10 @@ export class AdminService { return this.adminRepository.findOne({ phone }); } + // async create(dto:CreateAdminDto){ + // this.em.create(dto) + // } + async finAdminById( adminId: string, restId: string, diff --git a/src/modules/business/business.service.ts b/src/modules/business/business.service.ts index e044781..f470bf4 100644 --- a/src/modules/business/business.service.ts +++ b/src/modules/business/business.service.ts @@ -19,7 +19,8 @@ export class BusinessService { throw new BadRequestException() } const business = this.em.create(Business, { ...dto, admin }) - return this.em.persistAndFlush(business) + await this.em.persistAndFlush(business) + return business } findAll() {