Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
search: initialize opaque if nil for ListContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuAlfageme committed Dec 5, 2022
1 parent 0bbe5e6 commit fd39df2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/grpc/services/storageprovider/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (

rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/pkg/appctx"
"github.com/cs3org/reva/pkg/errtypes"
"github.com/cs3org/reva/pkg/mime"
Expand Down Expand Up @@ -941,6 +942,10 @@ func (s *service) ListContainer(ctx context.Context, req *provider.ListContainer
}

// Ugly hack to enable search
if req.Opaque == nil {
req.Opaque = &typesv1beta1.Opaque{Map: make(map[string]*typesv1beta1.OpaqueEntry)}
}

if req.Opaque.Map["search"] != nil {
s.storage.ListFolder(ctx, newRef, []string{"search", string(req.Opaque.Map["searchString"].GetValue())})
}
Expand Down

0 comments on commit fd39df2

Please sign in to comment.