diff --git a/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java b/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java index 14691d8..0fe79e6 100644 --- a/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java +++ b/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java @@ -34,6 +34,8 @@ public class ChapterList implements Response { JSONObject chapterJSON = new JSONObject(); chapterJSON.put("id", chapter.getId()); chapterJSON.put("name", chapter.getName()); + if (chapter.getStartDate() != null) chapterJSON.put("startDate", chapter.getStartDate()); + if (chapter.getEndDate() != null) chapterJSON.put("endDate", chapter.getEndDate()); chaptersJSON.add(chapterJSON); } writer.write(chaptersJSON.toJSONString());