mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
add initial exception
This commit is contained in:
@@ -96,6 +96,10 @@ public class CommunityRestRepository extends DSpaceRestRepository<CommunityRest,
|
|||||||
// with pagination and authorization check
|
// with pagination and authorization check
|
||||||
@SearchRestMethod(name = "subCommunities")
|
@SearchRestMethod(name = "subCommunities")
|
||||||
public Page<CommunityRest> findSubCommunities(@Param(value = "parent") UUID parentCommunity, Pageable pageable) {
|
public Page<CommunityRest> findSubCommunities(@Param(value = "parent") UUID parentCommunity, Pageable pageable) {
|
||||||
|
if (parentCommunity == null) {
|
||||||
|
throw new IllegalArgumentException("Missing parameter 'parent'. "
|
||||||
|
+ "This parameter should contain the UUID of a parent community");
|
||||||
|
}
|
||||||
Context context = obtainContext();
|
Context context = obtainContext();
|
||||||
List<Community> subCommunities = new ArrayList<Community>();
|
List<Community> subCommunities = new ArrayList<Community>();
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user