From 3f476680a3b3bdd98379093d87e2273ff2b16621 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Mon, 4 Dec 2023 17:41:05 +0545 Subject: [PATCH] return 200 and not 201 when creating sharing link --- services/graph/pkg/service/v0/links.go | 2 +- services/graph/pkg/service/v0/links_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/graph/pkg/service/v0/links.go b/services/graph/pkg/service/v0/links.go index 5efb1bdfe8..0bfd6aac15 100644 --- a/services/graph/pkg/service/v0/links.go +++ b/services/graph/pkg/service/v0/links.go @@ -51,7 +51,7 @@ func (g Graph) CreateLink(w http.ResponseWriter, r *http.Request) { return } - render.Status(r, http.StatusCreated) + render.Status(r, http.StatusOK) render.JSON(w, r, []libregraph.Permission{*perm}) } diff --git a/services/graph/pkg/service/v0/links_test.go b/services/graph/pkg/service/v0/links_test.go index d42c788081..8376e7b58b 100644 --- a/services/graph/pkg/service/v0/links_test.go +++ b/services/graph/pkg/service/v0/links_test.go @@ -163,7 +163,7 @@ var _ = Describe("createLinkTests", func() { WithContext(ctx), ) - Expect(rr.Code).To(Equal(http.StatusCreated)) + Expect(rr.Code).To(Equal(http.StatusOK)) var createLinkResponseBody []*libregraph.Permission err := json.Unmarshal(rr.Body.Bytes(), &createLinkResponseBody) @@ -355,7 +355,7 @@ var _ = Describe("createLinkTests", func() { WithContext(ctx), ) - Expect(rr.Code).To(Equal(http.StatusCreated)) + Expect(rr.Code).To(Equal(http.StatusOK)) var createLinkResponseBody []*libregraph.Permission err = json.Unmarshal(rr.Body.Bytes(), &createLinkResponseBody)