@@ -33,13 +33,14 @@ import (
33
33
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/conversions"
34
34
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/response"
35
35
"github.com/cs3org/reva/v2/pkg/appctx"
36
+ "github.com/cs3org/reva/v2/pkg/publicshare"
36
37
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
37
38
"github.com/pkg/errors"
38
39
)
39
40
40
41
// QuicklinkName is the reserved name for a quicklink.
41
42
// Creating (or updating) a link with (to) the same name will be blocked by the server
42
- var QuicklinkName = "Quicklink"
43
+ const QuicklinkName = "Quicklink"
43
44
44
45
func (h * Handler ) createPublicLinkShare (w http.ResponseWriter , r * http.Request , statInfo * provider.ResourceInfo ) (* link.PublicShare , * ocsError ) {
45
46
ctx := r .Context ()
@@ -76,16 +77,7 @@ func (h *Handler) createPublicLinkShare(w http.ResponseWriter, r *http.Request,
76
77
77
78
// check if a quicklink should be created
78
79
if quick {
79
- _ , f , err := h .addFilters (w , r , & provider.Reference {ResourceId : statInfo .Id })
80
- if err != nil {
81
- log .Error ().Err (err ).Msg ("could not add filters" )
82
- return nil , & ocsError {
83
- Code : response .MetaServerError .StatusCode ,
84
- Message : "could not add filters" ,
85
- Error : err ,
86
- }
87
- }
88
-
80
+ f := []* link.ListPublicSharesRequest_Filter {publicshare .ResourceIDFilter (statInfo .Id )}
89
81
req := link.ListPublicSharesRequest {Filters : f }
90
82
res , err := c .ListPublicShares (ctx , & req )
91
83
if err != nil {
0 commit comments