fix: update status product
This commit is contained in:
parent
4f03fee759
commit
09e13a0435
|
@ -524,10 +524,15 @@ export class ProductService {
|
||||||
updateProductDto.subCategoriesId,
|
updateProductDto.subCategoriesId,
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.productHistoryStatus.update(id, {
|
const dataStatus = await this.productHistoryStatus.findOne({
|
||||||
status: updateProductDto.status,
|
where: {
|
||||||
|
product: id,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await this.productHistoryStatus.update(dataStatus.id, {
|
||||||
|
status: updateProductDto.status,
|
||||||
|
});
|
||||||
const result = await this.productRepository.update(id, {
|
const result = await this.productRepository.update(id, {
|
||||||
name: updateProductDto.name,
|
name: updateProductDto.name,
|
||||||
code: updateProductDto.code,
|
code: updateProductDto.code,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user