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 { 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,
+2 -1
View File
@@ -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() {