barname
This commit is contained in:
@@ -23,13 +23,13 @@ export class BarnameService {
|
||||
) { }
|
||||
|
||||
async createBarname(dto: CreateBarnameDto, business: Business, userId: string) {
|
||||
const { description, driverName, driverPhone, carType, exitAt, origin, plaque, weight,attachments } = dto;
|
||||
const { description, driverName, driverPhone, carType, exitAt, origin, plaque, weight, attachments } = dto;
|
||||
|
||||
const company = await this.em.findOne(Company, { business, user: { id: userId }, deletedAt: null });
|
||||
if (!company) throw new BadRequestException(CompanyMessage.COMPANY_NOT_FOUND);
|
||||
|
||||
const bill = this.em.create(Barname,
|
||||
{ carType, exitAt, origin, plaque, weight, business, description, driverName, driverPhone, company,attachments });
|
||||
{ carType, exitAt, origin, plaque, weight, business, description, driverName, driverPhone, company, attachments });
|
||||
|
||||
await this.em.persistAndFlush(bill);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user