Nested folders: Fix moving folder under root (#65684)
* Nested folders: Fix moving folder under root * Add store test for not empty parent after update * Modify folder and document store update implementation Move folder only if NewParentUID is not nil * Apply suggestion from code review
This commit is contained in:
@@ -543,10 +543,14 @@ func (s *Service) Move(ctx context.Context, cmd *folder.MoveFolderCommand) (*fol
|
||||
}
|
||||
}
|
||||
|
||||
newParentUID := ""
|
||||
if cmd.NewParentUID != "" {
|
||||
newParentUID = cmd.NewParentUID
|
||||
}
|
||||
return s.store.Update(ctx, folder.UpdateFolderCommand{
|
||||
UID: cmd.UID,
|
||||
OrgID: cmd.OrgID,
|
||||
NewParentUID: &cmd.NewParentUID,
|
||||
NewParentUID: &newParentUID,
|
||||
SignedInUser: cmd.SignedInUser,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user