Return updated scene after update

This commit is contained in:
WithoutPants 2019-10-15 10:54:05 +11:00
parent 0852199e27
commit 4433917768
1 changed files with 6 additions and 2 deletions

View File

@ -71,13 +71,17 @@ func (qb *SceneQueryBuilder) Update(updatedScene ScenePartial, tx *sqlx.Tx) (*Sc
return nil, err
}
return qb.Find(updatedScene.ID)
return qb.find(updatedScene.ID, tx)
}
func (qb *SceneQueryBuilder) Find(id int) (*Scene, error) {
return qb.find(id, nil)
}
func (qb *SceneQueryBuilder) find(id int, tx *sqlx.Tx) (*Scene, error) {
query := "SELECT * FROM scenes WHERE id = ? LIMIT 1"
args := []interface{}{id}
return qb.queryScene(query, args, nil)
return qb.queryScene(query, args, tx)
}
func (qb *SceneQueryBuilder) FindByChecksum(checksum string) (*Scene, error) {