Make PUT on /projects/<name>/parent return the new parent name
PUT on /projects/<name>/parent should return the same as GET on the same URL will return after the PUT was done. GET on /projects/<name>/parent returns the name of the parent project and PUT should do the same. At the moment PUT on /projects/<name>/parent returns the updated ProjectInfo entity of the project for which the parent was updated. The documentation of this REST endpoint already describes the new behaviour. Change-Id: Iac2623a5d31ea76ebe13a8a7da1ba844468f9bb2 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -54,7 +54,7 @@ class SetParent implements RestModifyView<ProjectResource, Input> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object apply(ProjectResource resource, Input input)
|
||||
public String apply(ProjectResource resource, Input input)
|
||||
throws AuthException, BadRequestException, ResourceConflictException,
|
||||
Exception {
|
||||
ProjectControl ctl = resource.getControl();
|
||||
@@ -83,11 +83,8 @@ class SetParent implements RestModifyView<ProjectResource, Input> {
|
||||
config.commit(md);
|
||||
cache.evict(ctl.getProject());
|
||||
|
||||
ListProjects.ProjectInfo info = new ListProjects.ProjectInfo();
|
||||
info.setName(resource.getName());
|
||||
info.parent = project.getParentName();
|
||||
info.description = project.getDescription();
|
||||
return info;
|
||||
Project.NameKey parentName = project.getParent(allProjects);
|
||||
return parentName != null ? parentName.get() : "";
|
||||
} finally {
|
||||
md.close();
|
||||
}
|
||||
|
Reference in New Issue
Block a user