From 436b3058a4f10fb3573565fc7281a5a2ca8cd903 Mon Sep 17 00:00:00 2001 From: bill-moj <167539377+bill-moj@users.noreply.github.com> Date: Wed, 6 Nov 2024 11:43:16 +0000 Subject: [PATCH] make review.reviewDate non-nullable (#319) --- server/@types/csip/index.d.ts | 8 ++++---- server/routes/csip-records/components/reviews.njk | 2 +- server/routes/journeys/base/patchReviewController.ts | 2 +- server/routes/journeys/update-review/controller.ts | 2 +- server/routes/journeys/update-review/view.njk | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/@types/csip/index.d.ts b/server/@types/csip/index.d.ts index 70f4829b..a331d203 100644 --- a/server/@types/csip/index.d.ts +++ b/server/@types/csip/index.d.ts @@ -810,7 +810,7 @@ export interface components { * @description The date of the review. * @example 2021-09-27 */ - reviewDate?: string + reviewDate: string /** @description The username of the person who recorded the review. */ recordedBy: string /** @description The displayable name of the person who recorded the review. */ @@ -1250,7 +1250,7 @@ export interface components { * @description The date of the review. * @example 2021-09-27 */ - reviewDate?: string + reviewDate: string /** @description The username of the person who recorded the review. */ recordedBy: string /** @description The displayable name of the person who recorded the review. */ @@ -1400,7 +1400,7 @@ export interface components { * @description The date of the review. * @example 2021-09-27 */ - reviewDate?: string + reviewDate: string /** @description The username of the person who recorded the review. */ recordedBy: string /** @description The displayable name of the person who recorded the review. */ @@ -1530,7 +1530,7 @@ export interface components { * @description The date of the review. * @example 2021-09-27 */ - reviewDate?: string + reviewDate: string /** @description The username of the person who recorded the review. */ recordedBy: string /** @description The displayable name of the person who recorded the review. */ diff --git a/server/routes/csip-records/components/reviews.njk b/server/routes/csip-records/components/reviews.njk index e6a89bd7..9717e2ed 100644 --- a/server/routes/csip-records/components/reviews.njk +++ b/server/routes/csip-records/components/reviews.njk @@ -37,7 +37,7 @@ text: 'Review date' }, value: { - text: (review.reviewDate | formatDisplayDate) or 'Not provided' + text: review.reviewDate | formatDisplayDate } }, { diff --git a/server/routes/journeys/base/patchReviewController.ts b/server/routes/journeys/base/patchReviewController.ts index 938da918..dafab999 100644 --- a/server/routes/journeys/base/patchReviewController.ts +++ b/server/routes/journeys/base/patchReviewController.ts @@ -29,7 +29,7 @@ export class PatchReviewController extends BaseJourneyController { const payload = { recordedBy: review.recordedBy, recordedByDisplayName: review.recordedByDisplayName, - ...getNonUndefinedProp(review, 'reviewDate'), + reviewDate: review.reviewDate, ...getNonUndefinedProp(review, 'nextReviewDate'), ...getNonUndefinedProp(review, 'summary'), ...getNonUndefinedProp(review, 'csipClosedDate'), diff --git a/server/routes/journeys/update-review/controller.ts b/server/routes/journeys/update-review/controller.ts index 60d0a81d..d77cec15 100644 --- a/server/routes/journeys/update-review/controller.ts +++ b/server/routes/journeys/update-review/controller.ts @@ -27,7 +27,7 @@ export class UpdateReviewController extends BaseJourneyController { req.journeyData.review = { reviewUuid: review.reviewUuid, - ...getNonUndefinedProp(review, 'reviewDate'), + reviewDate: review.reviewDate, ...getNonUndefinedProp(review, 'nextReviewDate'), ...getNonUndefinedProp(review, 'summary'), outcome: review.csipClosedDate ? 'CLOSE_CSIP' : 'REMAIN_ON_CSIP', diff --git a/server/routes/journeys/update-review/view.njk b/server/routes/journeys/update-review/view.njk index 1ae7f1eb..9b58b04e 100644 --- a/server/routes/journeys/update-review/view.njk +++ b/server/routes/journeys/update-review/view.njk @@ -29,7 +29,7 @@ text: "Review date" }, value: { - html: (review.reviewDate | formatDisplayDate) or 'Not provided' + html: review.reviewDate | formatDisplayDate } }, {