Folders: Do not allow modifying the folder UID via the API (#74684)
* Folders: Do not allow changing the folder UID via the API * Update Swagger/OpenAPI docs * Update HTTP API docs
This commit is contained in:
committed by
GitHub
parent
2fac3bd41e
commit
376f9a75db
@@ -92,7 +92,7 @@ func (ss *sqlStore) Update(ctx context.Context, cmd folder.UpdateFolderCommand)
|
||||
|
||||
var foldr *folder.Folder
|
||||
|
||||
if cmd.NewDescription == nil && cmd.NewTitle == nil && cmd.NewUID == nil && cmd.NewParentUID == nil {
|
||||
if cmd.NewDescription == nil && cmd.NewTitle == nil && cmd.NewParentUID == nil {
|
||||
return nil, folder.ErrBadRequest.Errorf("nothing to update")
|
||||
}
|
||||
err := ss.db.WithDbSession(ctx, func(sess *db.Session) error {
|
||||
@@ -110,12 +110,6 @@ func (ss *sqlStore) Update(ctx context.Context, cmd folder.UpdateFolderCommand)
|
||||
args = append(args, *cmd.NewTitle)
|
||||
}
|
||||
|
||||
if cmd.NewUID != nil {
|
||||
columnsToUpdate = append(columnsToUpdate, "uid = ?")
|
||||
uid = *cmd.NewUID
|
||||
args = append(args, *cmd.NewUID)
|
||||
}
|
||||
|
||||
if cmd.NewParentUID != nil {
|
||||
if *cmd.NewParentUID == "" {
|
||||
columnsToUpdate = append(columnsToUpdate, "parent_uid = NULL")
|
||||
|
||||
Reference in New Issue
Block a user