Using squirrel to generalize SQL search

This commit is contained in:
Deluan
2020-01-13 15:28:55 -05:00
committed by Deluan Quintão
parent d3af7e689d
commit c2448d3880
10 changed files with 134 additions and 34 deletions
+3 -1
View File
@@ -30,7 +30,9 @@ func NewPlaylistRepository() domain.PlaylistRepository {
func (r *playlistRepository) Put(p *domain.Playlist) error {
tp := r.fromDomain(p)
return r.put(p.ID, &tp)
return WithTx(func(o orm.Ormer) error {
return r.put(o, p.ID, &tp)
})
}
func (r *playlistRepository) Get(id string) (*domain.Playlist, error) {