Merge pull request #7876 from owncloud/return200OnCreateLink

return 200 and not 201 when creating sharing link
This commit is contained in:
Artur Neumann
2023-12-04 18:58:19 +05:45
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -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})
}

View File

@@ -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)