Update listMyCourses to remove course property

Signed-off-by: Jonas-Ian Kuche's avatarJonas-Ian Kuche <jonas-ian.kuche@mni.thm.de>
parent 8f199248
......@@ -96,11 +96,6 @@ class DBMapper {
.put("role", input.getString("role"));
}
public static JsonObject mapMyCourse(JsonObject input) {
JsonObject course = mapCourse(input);
return new JsonObject().put("course", course);
}
public static JsonObject mapUser(JsonObject input) {
return new JsonObject()
.put("id", input.getInteger("idperson"))
......
......@@ -48,7 +48,7 @@ public class UserController {
RestVerticle.db.getCoursesForUser(userID, roles, coursesPromise);
coursesPromise.future().onSuccess(courses -> {
ResponseUtils.jsonResponse(context, 200, DBMapper.mapMany(courses, DBMapper::mapMyCourse));
ResponseUtils.jsonResponse(context, 200, DBMapper.mapMany(courses, DBMapper::mapCourse));
}).onFailure(err -> ResponseUtils.internalServerErrorResponse(context, err));
}
......
Subproject commit 8198669901e35af81550e2b0231989f2ebfbdb3e
Subproject commit c524a67be0b1bde0f86b3c8e5a71503d732db0e8
......@@ -66,8 +66,7 @@ public class MyCoursesTest extends TestBase {
JsonArray resBody = res.bodyAsJsonArray();
context.assertEquals(expectedCount, resBody.size());
for (int i = 0; i < resBody.size(); i++) {
JsonObject resObj = resBody.getJsonObject(i);
JsonObject course = resObj.getJsonObject("course");
JsonObject course = resBody.getJsonObject(i);
context.assertNotNull(course.getString("name"));
context.assertNotNull(course.getString("semester"));
context.assertNotNull(course.getBoolean("protected"));
......
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