Library/models/publishers_update.go
konrad 64dd0ce2d0
Some checks failed
the build failed
Fixed lint
2017-11-08 10:55:17 +01:00

16 lines
419 B
Go

package models
// UpdatePublisher updates a publisher, takes an ID and a publisher struct with the new publisher infos
func UpdatePublisher(publisher Publisher, id int64) (newPublisher Publisher, err error) {
_, err = x.Where("id = ?", id).Update(&publisher)
if err != nil {
return Publisher{}, err
}
// Get the newly updated publisher
newPublisher, _, err = GetPublisherByID(id)
return newPublisher, err
}