func (r *TopicRepository) Update(topic *core.Topic) error { _, err := dat.Update(r, topic.ID(), topic) if err != nil { log.Printf("Error updating topic: %s", err) } return err }
func (r *TopicRepository) Save(topic *core.Topic) error { result, err := dat.Create(r, topic) if err != nil { log.Printf("Error creating new topic: %s", err) return err } topic.SetID(result.GeneratedKeys[0]) return nil }