Commit 4082cbe4 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

provide owner nlogin in the response

parent 793b7617
Pipeline #43216 passed with stage
in 21 minutes and 3 seconds
......@@ -40,7 +40,6 @@ public class CommentRestImpl extends BaseRestImpl {
private IElementService elementService;
private IReactionService reactionService;
private PointTransformation pt = new PointTransformation();
@Autowired
......@@ -95,11 +94,6 @@ public class CommentRestImpl extends BaseRestImpl {
private Map<String, Object> preparedComment(Comment comment, Set<String> columnsSet) {
Map<String, Object> result = new TreeMap<>();
result.put("isPinned", comment.isPinned());
if (comment.getUser() != null) {
result.put("owner", comment.getUser().getLogin());
} else {
result.put("owner", null);
}
for (String string : columnsSet) {
String column = string.toLowerCase();
Object value;
......@@ -141,6 +135,13 @@ public class CommentRestImpl extends BaseRestImpl {
case "email":
value = comment.getEmail();
break;
case "owner":
if (comment.getUser() != null) {
value = comment.getUser().getLogin();
} else {
value = null;
}
break;
default:
value = "Unknown column";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment