From 5ceeb5119b50d492aa6b0af44b5fa100f1eac0fd Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Thu, 30 Nov 2023 10:10:07 +0545 Subject: [PATCH] return 200 on successfull invite --- services/graph/pkg/service/v0/driveitems.go | 2 +- services/graph/pkg/service/v0/driveitems_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/graph/pkg/service/v0/driveitems.go b/services/graph/pkg/service/v0/driveitems.go index 7124c3995a..55b5081023 100644 --- a/services/graph/pkg/service/v0/driveitems.go +++ b/services/graph/pkg/service/v0/driveitems.go @@ -494,7 +494,7 @@ func (g Graph) Invite(w http.ResponseWriter, r *http.Request) { case hasErrors && hasSuccesses: render.Status(r, http.StatusMultiStatus) case hasSuccesses: - render.Status(r, http.StatusCreated) + render.Status(r, http.StatusOK) default: render.Status(r, http.StatusInternalServerError) } diff --git a/services/graph/pkg/service/v0/driveitems_test.go b/services/graph/pkg/service/v0/driveitems_test.go index a3ef19371f..e34e6f7845 100644 --- a/services/graph/pkg/service/v0/driveitems_test.go +++ b/services/graph/pkg/service/v0/driveitems_test.go @@ -322,7 +322,7 @@ var _ = Describe("Driveitems", func() { jsonData := gjson.Get(rr.Body.String(), "value") - Expect(rr.Code).To(Equal(http.StatusCreated)) + Expect(rr.Code).To(Equal(http.StatusOK)) Expect(jsonData.Get("#").Num).To(Equal(float64(2))) Expect(jsonData.Get("0.id").Str).To(Equal("123")) @@ -347,7 +347,7 @@ var _ = Describe("Driveitems", func() { jsonData := gjson.Get(rr.Body.String(), "value") - Expect(rr.Code).To(Equal(http.StatusCreated)) + Expect(rr.Code).To(Equal(http.StatusOK)) Expect(jsonData.Get(`0.@libre\.graph\.permissions\.actions`).Exists()).To(BeFalse()) Expect(jsonData.Get("0.roles.#").Num).To(Equal(float64(1))) @@ -365,7 +365,7 @@ var _ = Describe("Driveitems", func() { jsonData := gjson.Get(rr.Body.String(), "value") - Expect(rr.Code).To(Equal(http.StatusCreated)) + Expect(rr.Code).To(Equal(http.StatusOK)) Expect(jsonData.Get("0.roles").Exists()).To(BeFalse()) Expect(jsonData.Get(`0.@libre\.graph\.permissions\.actions.#`).Num).To(Equal(float64(1)))