business
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user