Skip to content

Commit

Permalink
fix: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
fschade committed Nov 28, 2023
1 parent 97a4895 commit ae5a228
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 53 deletions.
46 changes: 0 additions & 46 deletions services/graph/pkg/service/v0/driveitems_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,26 +397,6 @@ var _ = Describe("Driveitems", func() {
}, http.StatusBadRequest),
)

DescribeTable("Stat",
func(prep func(), code int) {
prep()
svc.Invite(
rr,
httptest.NewRequest(http.MethodPost, "/", toJSONReader(driveItemInvite)).
WithContext(ctx),
)

Expect(rr.Code).To(Equal(code))
statMock.Parent.AssertNumberOfCalls(GinkgoT(), "Stat", 1)
},
Entry("fails if not ok", func() {
statResponse.Status = status.NewNotFound(context.Background(), "")
}, http.StatusInternalServerError),
Entry("fails if errors", func() {
statMock.Return(nil, errors.New("error"))
}, http.StatusInternalServerError),
)

DescribeTable("GetGroup",
func(prep func(), code int) {
driveItemInvite.Recipients = []libregraph.DriveRecipient{
Expand Down Expand Up @@ -567,32 +547,6 @@ var _ = Describe("Driveitems", func() {
Expect(value.Get("#").Num).To(Equal(float64(1)))
Expect(value.Get("0.id").Str).To(Equal("123"))
})

DescribeTable("fails",
func(prep func(), code int) {
prep()
svc.ListPermissions(
rr,
httptest.NewRequest(http.MethodGet, "/", nil).
WithContext(ctx),
)

Expect(rr.Code).To(Equal(code))
statMock.Parent.AssertNumberOfCalls(GinkgoT(), "Stat", 1)
},
Entry("if stat is not ok", func() {
statResponse.Status = status.NewNotFound(context.Background(), "")
}, http.StatusInternalServerError),
Entry("if stat errors", func() {
statMock.Return(nil, errors.New("error"))
}, http.StatusInternalServerError),
Entry("if the stat info is invalid", func() {
statMock.Return(&provider.StatResponse{
Status: status.NewOK(ctx),
Info: &provider.ResourceInfo{},
}, nil)
}, http.StatusInternalServerError),
)
})

Describe("GetRootDriveChildren", func() {
Expand Down
10 changes: 6 additions & 4 deletions services/graph/pkg/service/v0/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ import (
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1"
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/v2/pkg/utils"
"github.com/go-chi/render"
libregraph "github.com/owncloud/libre-graph-api-go"

"github.com/cs3org/reva/v2/pkg/utils"
"github.com/owncloud/ocis/v2/services/graph/pkg/errorcode"
"github.com/owncloud/ocis/v2/services/graph/pkg/linktype"
"github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/errorcode"
)

// CreateLink creates a public link on the cs3 api
func (g Graph) CreateLink(w http.ResponseWriter, r *http.Request) {
logger := g.logger.SubloggerWithRequestID(r.Context())
logger.Info().Msg("calling create link")

_, driveItemID, ok := g.GetDriveAndItemIDParam(w, r)
if !ok {
_, driveItemID, err := g.GetDriveAndItemIDParam(r)
if err != nil {
errorcode.RenderError(w, r, err)
return
}

Expand Down
6 changes: 3 additions & 3 deletions services/graph/pkg/service/v0/sharedbyme.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
collaboration "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1"
storageprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/v2/pkg/share"
"github.com/cs3org/reva/v2/pkg/storagespace"
"github.com/go-chi/render"
libregraph "github.com/owncloud/libre-graph-api-go"

"github.com/owncloud/ocis/v2/ocis-pkg/conversions"
"github.com/cs3org/reva/v2/pkg/share"
"github.com/cs3org/reva/v2/pkg/storagespace"

"github.com/owncloud/ocis/v2/services/graph/pkg/errorcode"
"github.com/owncloud/ocis/v2/services/graph/pkg/identity"
"github.com/owncloud/ocis/v2/services/graph/pkg/unifiedrole"
Expand Down

0 comments on commit ae5a228

Please sign in to comment.