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