mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Merge pull request #2253 from tantz001/DS-4050
DS-4050 Search method returns 204 NoContent or 200 for empty page if no result.
This commit is contained in:
@@ -932,11 +932,7 @@ public class RestResourceController implements InitializingBean {
|
||||
result = assembler.toResource(resources, link);
|
||||
} else {
|
||||
if (searchResult == null) {
|
||||
try {
|
||||
response.sendError(HttpServletResponse.SC_NOT_FOUND);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
response.setStatus(HttpServletResponse.SC_NO_CONTENT);
|
||||
return null;
|
||||
}
|
||||
DSpaceResource<T> dsResource = repository.wrapResource((T) searchResult);
|
||||
|
@@ -338,7 +338,7 @@ public class EPersonRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/eperson/epersons/search/byEmail")
|
||||
.param("email", "undefined@undefined.com"))
|
||||
.andExpect(status().isNotFound());
|
||||
.andExpect(status().isNoContent());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user