feat: add status product column

This commit is contained in:
caturbgs 2021-12-22 14:47:04 +07:00
parent a0ee6b9040
commit cdd6d39c90

View File

@ -49,11 +49,17 @@ export class ProductService {
async findAll(page: number, supplier: string, subCategories: string) { async findAll(page: number, supplier: string, subCategories: string) {
let filterSupplier, filterSubCategories; let filterSupplier, filterSubCategories;
if (supplier) { if (supplier) {
filterSupplier = supplier.split(',').map((data) => data.trim()); filterSupplier = supplier.split(',').map((data) => {
return data.trim();
});
} }
if (subCategories) { if (subCategories) {
filterSubCategories = subCategories.split(',').map((data) => data.trim()); filterSubCategories = subCategories.split(',').map((data) => {
return data.trim();
});
} }
// if (supplier.length > 0) { // if (supplier.length > 0) {
// const dataSupplier = await this.supplierService.findByActiveAll(); // const dataSupplier = await this.supplierService.findByActiveAll();
@ -81,6 +87,7 @@ export class ProductService {
'product.code', 'product.code',
'sub_categories.name', 'sub_categories.name',
'category.name', 'category.name',
'product.status',
]) ])
.addSelect('current_price.price') .addSelect('current_price.price')
.addSelect( .addSelect(