Use new rest lib (Update receives all columns that need to be updated)

This commit is contained in:
Deluan
2021-11-01 13:55:47 -04:00
parent b2acec0a09
commit 778f474d26
14 changed files with 46 additions and 26 deletions
+3 -2
View File
@@ -46,9 +46,10 @@ func (r *shareRepository) Put(s *model.Share) error {
return err
}
func (r *shareRepository) Update(entity interface{}, cols ...string) error {
func (r *shareRepository) Update(id string, entity interface{}, cols ...string) error {
s := entity.(*model.Share)
_, err := r.put(s.ID, s, cols...)
s.ID = id
_, err := r.put(id, s, cols...)
if err == model.ErrNotFound {
return rest.ErrNotFound
}