mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
Correct returned collection of get all
This commit is contained in:
@@ -15,6 +15,7 @@ import sonia.scm.user.UserManager;
|
|||||||
import javax.ws.rs.*;
|
import javax.ws.rs.*;
|
||||||
import javax.ws.rs.core.*;
|
import javax.ws.rs.core.*;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -100,8 +101,8 @@ public class UserNewResource extends AbstractManagerResource<User, UserException
|
|||||||
@QueryParam("desc") boolean desc)
|
@QueryParam("desc") boolean desc)
|
||||||
{
|
{
|
||||||
Collection<User> items = fetchItems(sortby, desc, start, limit);
|
Collection<User> items = fetchItems(sortby, desc, start, limit);
|
||||||
items.stream().map(user -> userToDtoMapper.userToUserDto(user, uriInfo)).collect(Collectors.toList());
|
List<UserDto> collect = items.stream().map(user -> userToDtoMapper.userToUserDto(user, uriInfo)).collect(Collectors.toList());
|
||||||
return Response.ok(new GenericEntity<Collection<User>>(items) {}).build();
|
return Response.ok(new GenericEntity<Collection<UserDto>>(collect) {}).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@@ -122,6 +123,7 @@ public class UserNewResource extends AbstractManagerResource<User, UserException
|
|||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
@Path("")
|
||||||
@StatusCodes({
|
@StatusCodes({
|
||||||
@ResponseCode(code = 201, condition = "create success", additionalHeaders = {
|
@ResponseCode(code = 201, condition = "create success", additionalHeaders = {
|
||||||
@ResponseHeader(name = "Location", description = "uri to the created group")
|
@ResponseHeader(name = "Location", description = "uri to the created group")
|
||||||
|
|||||||
Reference in New Issue
Block a user