diff --git a/pkg/api/folder.go b/pkg/api/folder.go index fcaf655848c..1a9aa95afcf 100644 --- a/pkg/api/folder.go +++ b/pkg/api/folder.go @@ -176,12 +176,9 @@ func (hs *HTTPServer) MoveFolder(c *models.ReqContext) response.Response { var theFolder *folder.Folder var err error if cmd.NewParentUID != "" { - moveCommand := folder.MoveFolderCommand{ - UID: web.Params(c.Req)[":uid"], - NewParentUID: cmd.NewParentUID, - OrgID: c.OrgID, - } - theFolder, err = hs.folderService.Move(c.Req.Context(), &moveCommand) + cmd.OrgID = c.OrgID + cmd.UID = web.Params(c.Req)[":uid"] + theFolder, err = hs.folderService.Move(c.Req.Context(), &cmd) if err != nil { return response.Error(http.StatusInternalServerError, "update folder uid failed", err) } diff --git a/pkg/services/folder/model.go b/pkg/services/folder/model.go index 62ae6a77b0b..50394685b9b 100644 --- a/pkg/services/folder/model.go +++ b/pkg/services/folder/model.go @@ -95,8 +95,8 @@ type UpdateFolderCommand struct { // MoveFolderCommand captures the information required by the folder service // to move a folder. type MoveFolderCommand struct { - UID string `json:"uid"` - NewParentUID string `json:"newParentUid"` + UID string `json:"-"` + NewParentUID string `json:"parentUid"` OrgID int64 `json:"-"` SignedInUser *user.SignedInUser `json:"-"`