categories update4

This commit is contained in:
merdan 2023-02-08 11:42:21 +05:00
parent 5e8ec82e44
commit f7e0a9c8fb
1 changed files with 4 additions and 4 deletions

View File

@ -339,7 +339,7 @@ func (importer *Importer) importVariant(product models.Product) (*gm.Product, er
return nil, err3
}
return &barProduct,nil
return &barProduct,tx.Commit().Error;
}else{
tx.Rollback()
return nil, err
@ -509,9 +509,9 @@ func (importer *Importer) updateVariant(product models.Product) (*gm.Product, er
var flat gm.ProductFlat
err := importer.baza.Preload("Product").Preload("Variants").First(&flat, "sku = ?", product.ProductNumber).Error
if err != nil {
//if errors.Is(err,gorm.ErrRecordNotFound) {
// return importer.importVariant(product)
//}
if errors.Is(err,gorm.ErrRecordNotFound) {
return importer.importVariant(product)
}
//todo not found bolsa create etmeli
return nil, err
}