cinsiyet eklenior
This commit is contained in:
parent
b4900a055b
commit
fd072f42cc
|
|
@ -27,7 +27,7 @@ func FindOrCreateBrand(db *gorm.DB, brand string, categories []Category) (Brand,
|
|||
code := slug.Make(brand)
|
||||
|
||||
//err := db.Omit("Categories").FirstOrCreate(&brandObject, Brand{Name: brand, Code: code, Categories: categories}).Error
|
||||
err := db.Model(&Brand{}).Find(&brandObject,Brand{Name: brand, Code: code}).Error
|
||||
err := db.Model(Brand{Name: brand, Code: code}).First(&brandObject).Error
|
||||
|
||||
if err != nil {
|
||||
err := db.Omit("Categories").FirstOrCreate(&brandObject, Brand{Name: brand, Code: code, Categories: categories}).Error
|
||||
|
|
|
|||
Loading…
Reference in New Issue