before updateding test data

This commit is contained in:
Gani Georgiev
2022-08-07 20:58:21 +03:00
parent a426484916
commit 6e9d000426
16 changed files with 323 additions and 75 deletions

View File

@@ -128,11 +128,11 @@ func (dao *Dao) Delete(m models.Model) error {
// Save upserts (update or create if primary key is not set) the provided model.
func (dao *Dao) Save(m models.Model) error {
if !m.IsNew() {
return dao.update(m)
if m.IsNew() {
return dao.create(m)
}
return dao.create(m)
return dao.update(m)
}
func (dao *Dao) update(m models.Model) error {