fix: order product
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user