15 lines
315 B
Go
15 lines
315 B
Go
package models
|
|
|
|
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
|
|
}
|