fix: order product

This commit is contained in:
ilham
2021-12-15 08:51:05 +07:00
parent e8bbc1e554
commit 53575f36d6
9 changed files with 125 additions and 54 deletions

View File

@@ -13,7 +13,6 @@ import { UpdateProductDto } from './dto/product/update-product.dto';
import { ProductHistoryPrice } from './entities/product-history-price.entity';
import { productType } from '../helper/enum-list';
import { UpdatePriceProductDto } from './dto/product/update-price-product.dto';
import { Raw } from 'typeorm/browser';
import { UsersService } from '../users/users.service';
import { SupplierService } from '../users/supplier/supplier.service';
@@ -132,7 +131,12 @@ export class ProductService {
async findOne(code: string) {
try {
return await this.productRepository.findOneOrFail({ code: code });
return await this.productRepository.findOneOrFail({
relations: ['supplier'],
where: {
code: code,
},
});
} catch (e) {
if (e instanceof EntityNotFoundError) {
throw new HttpException(