Add tests to core.Share

This commit is contained in:
Deluan
2021-06-08 16:32:08 -04:00
parent 110e17b004
commit 6c1ba8f0d0
2 changed files with 53 additions and 5 deletions
+2 -5
View File
@@ -41,17 +41,14 @@ type shareRepositoryWrapper struct {
func (r *shareRepositoryWrapper) Save(entity interface{}) (string, error) {
s := entity.(*model.Share)
id, err := gonanoid.Generate("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 9)
s.Name = id
if err != nil {
return "", err
}
s.Name = id
id, err = r.Persistable.Save(s)
return id, err
}
func (r *shareRepositoryWrapper) Update(entity interface{}, _ ...string) error {
s := entity.(*model.Share)
cols := []string{"description"}
err := r.Persistable.Update(s, cols...)
return err
return r.Persistable.Update(entity, "description")
}