diff --git a/controllers/ImportController.go b/controllers/ImportController.go index 322bfdc..7af75db 100644 --- a/controllers/ImportController.go +++ b/controllers/ImportController.go @@ -249,15 +249,17 @@ func ImportProduct(product models.Product, db *gorm.DB) error { tx := *db.Begin() categories, keywords, errCat := getCats(&tx, product.Categories) + log.Println(categories) if errCat != nil { - log.Println("ERR0001" + errCat.Error()) + log.Println("ERR0 Categories" + errCat.Error()) + tx.Rollback() return errCat } brand, err := gm.FindOrCreateBrand(&tx, product.Brand, categories) if err != nil { tx.Rollback() - log.Println(err) + log.Println("ERR BRAND" + err.Error()) return err } diff --git a/gorm_models/family.go b/gorm_models/family.go index 5e1b279..82f971d 100644 --- a/gorm_models/family.go +++ b/gorm_models/family.go @@ -10,7 +10,7 @@ type AttributeOption struct { ID uint `gorm:"primaryKey"` AttributeID uint AdminName string - Position int + SortOrder int `sql:"DEFAULT:NULL" gorm:"default:null"` } type Attribute struct {