From bfba4ec671e203dea49dbe711cc64550b512ab20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Wed, 11 Mar 2026 09:19:35 +0100 Subject: [PATCH] Render the followed drive item after following it according to the spec --- services/graph/pkg/service/v0/follow.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/graph/pkg/service/v0/follow.go b/services/graph/pkg/service/v0/follow.go index 8f3ba93a4f..4ccf20c171 100644 --- a/services/graph/pkg/service/v0/follow.go +++ b/services/graph/pkg/service/v0/follow.go @@ -5,6 +5,7 @@ import ( rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/go-chi/render" "github.com/opencloud-eu/opencloud/services/graph/pkg/errorcode" revaCtx "github.com/opencloud-eu/reva/v2/pkg/ctx" revactx "github.com/opencloud-eu/reva/v2/pkg/ctx" @@ -89,7 +90,14 @@ func (g Graph) FollowDriveItem(w http.ResponseWriter, r *http.Request) { } } - w.WriteHeader(http.StatusCreated) + driveItem, err := cs3ResourceToDriveItem(g.logger, statRes.GetInfo()) + if err != nil { + errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error()) + return + } + + render.Status(r, http.StatusCreated) + render.JSON(w, r, &driveItem) } // UnfollowDriveItem unmarks a drive item as favorite.