Skip to content

Commit

Permalink
fix: persist updated share
Browse files Browse the repository at this point in the history
  • Loading branch information
fschade committed Sep 11, 2024
1 parent 5fd1e89 commit cb37596
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pkg/ocm/share/repository/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ import (
ocm "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
typespb "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/google/uuid"
"github.com/pkg/errors"
"google.golang.org/genproto/protobuf/field_mask"

"github.com/cs3org/reva/v2/pkg/errtypes"
"github.com/cs3org/reva/v2/pkg/ocm/share"
"github.com/cs3org/reva/v2/pkg/ocm/share/repository/registry"
"github.com/cs3org/reva/v2/pkg/utils"
"github.com/cs3org/reva/v2/pkg/utils/cfg"
"github.com/google/uuid"
"github.com/pkg/errors"
"google.golang.org/genproto/protobuf/field_mask"
)

func init() {
Expand Down Expand Up @@ -466,7 +467,17 @@ func (m *mgr) UpdateShare(ctx context.Context, user *userpb.User, ref *ocm.Share
}
}

return s, nil
clone, err := cloneShare(s)
if err != nil {
return nil, err
}
m.model.Shares[s.Id.OpaqueId] = clone

if err := m.save(); err != nil {
return nil, errors.Wrap(err, "error saving share")
}

return clone, nil
}
}
}
Expand Down

0 comments on commit cb37596

Please sign in to comment.