14 lines
313 B
Go
14 lines
313 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
|
||
|
}
|