fix: update status product

This commit is contained in:
mfadiln2018 2022-08-29 16:10:14 +07:00
parent 4f03fee759
commit 09e13a0435

View File

@ -524,10 +524,15 @@ export class ProductService {
updateProductDto.subCategoriesId,
);
await this.productHistoryStatus.update(id, {
status: updateProductDto.status,
const dataStatus = await this.productHistoryStatus.findOne({
where: {
product: id,
},
});
await this.productHistoryStatus.update(dataStatus.id, {
status: updateProductDto.status,
});
const result = await this.productRepository.update(id, {
name: updateProductDto.name,
code: updateProductDto.code,