From f1b412558b52ec8fd8edde375ad0ebda7343140a Mon Sep 17 00:00:00 2001 From: niharikasingh84 Date: Fri, 26 Jul 2019 13:25:56 +0530 Subject: [PATCH] End Date updating to null Fix --- .../learner/actors/coursebatch/CourseBatchManagementActor.java | 3 +-- .../main/java/org/sunbird/models/course/batch/CourseBatch.java | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/learner/actors/coursebatch/CourseBatchManagementActor.java b/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/learner/actors/coursebatch/CourseBatchManagementActor.java index 948df5432a..5818d6edf2 100644 --- a/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/learner/actors/coursebatch/CourseBatchManagementActor.java +++ b/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/learner/actors/coursebatch/CourseBatchManagementActor.java @@ -673,8 +673,7 @@ private void updateCourseBatchDate(CourseBatch courseBatch, Map requestedStartDate != null ? (String) req.get(JsonKey.START_DATE) : courseBatch.getStartDate()); - courseBatch.setEndDate( - requestedEndDate != null ? (String) req.get(JsonKey.END_DATE) : courseBatch.getEndDate()); + courseBatch.setEndDate(requestedEndDate == null ? null : (String) req.get(JsonKey.END_DATE)); courseBatch.setEnrollmentEndDate( requestedEnrollmentEndDate == null ? null : (String) req.get(JsonKey.ENROLLMENT_END_DATE)); } diff --git a/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/models/course/batch/CourseBatch.java b/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/models/course/batch/CourseBatch.java index be47dc8f56..9decb1af9e 100644 --- a/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/models/course/batch/CourseBatch.java +++ b/actors/sunbird-lms-mw/actors/common/src/main/java/org/sunbird/models/course/batch/CourseBatch.java @@ -26,6 +26,8 @@ public class CourseBatch implements Serializable { private String createdDate; private List createdFor; private String description; + + @JsonInclude(JsonInclude.Include.ALWAYS) private String endDate; @JsonInclude(JsonInclude.Include.ALWAYS)