mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
Fix not found
This commit is contained in:
@@ -44,9 +44,12 @@ public class GroupResource extends AbstractManagerResource<Group, GroupException
|
||||
@ResponseCode(code = 500, condition = "internal server error")
|
||||
})
|
||||
public Response get(@Context Request request, @Context UriInfo uriInfo, @PathParam("id") String id) {
|
||||
Group group = manager.get(id);
|
||||
GroupDto groupDto = groupToGroupDtoMapper.map(group);
|
||||
return Response.ok(groupDto).build();
|
||||
Group group = manager.get(id);
|
||||
if (group == null) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
GroupDto groupDto = groupToGroupDtoMapper.map(group);
|
||||
return Response.ok(groupDto).build();
|
||||
}
|
||||
|
||||
@Path("")
|
||||
|
||||
@@ -46,9 +46,12 @@ public class UserResource extends AbstractManagerResource<User, UserException> {
|
||||
@ResponseCode(code = 500, condition = "internal server error")
|
||||
})
|
||||
public Response get(@Context Request request, @Context UriInfo uriInfo, @PathParam("id") String id) {
|
||||
User user = manager.get(id);
|
||||
UserDto userDto = userToDtoMapper.map(user);
|
||||
return Response.ok(userDto).build();
|
||||
User user = manager.get(id);
|
||||
if (user == null) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
UserDto userDto = userToDtoMapper.map(user);
|
||||
return Response.ok(userDto).build();
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
Reference in New Issue
Block a user