Folder: Add folder service implementation (#58182)

* Folder: Add folder service implementation

* Add Move

* Add tests

* Add new servie method and adjust Update, Delete and Move

* Remove contains

* GetTree return children of depth one
This commit is contained in:
idafurjes
2022-11-08 11:33:13 +01:00
committed by GitHub
parent 5cfd983cc2
commit af2f51f196
6 changed files with 157 additions and 4 deletions
@@ -120,6 +120,12 @@ func (ss *sqlStore) Update(ctx context.Context, cmd folder.UpdateFolderCommand)
args = append(args, cmd.Folder.UID)
}
if cmd.NewParentUID != nil {
columnsToUpdate = append(columnsToUpdate, "parent_uid = ?")
cmd.Folder.ParentUID = *cmd.NewParentUID
args = append(args, cmd.Folder.UID)
}
if len(columnsToUpdate) == 0 {
return folder.ErrBadRequest.Errorf("no columns to update")
}