From ec667d97b90d70b77e0886abb55f8ac3125f9bc3 Mon Sep 17 00:00:00 2001 From: ushahidlee <152860706+ushahidlee@users.noreply.github.com> Date: Tue, 21 May 2024 10:06:01 +0200 Subject: [PATCH] Small Fixes - Date and Init Errors (#1070) * needs more testing * Added a little fix to prevent errors on startup --- .../components/filter-control/filter-control.component.ts | 2 +- libs/sdk/src/lib/services/posts.service.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/web-mzima-client/src/app/shared/components/filter-control/filter-control.component.ts b/apps/web-mzima-client/src/app/shared/components/filter-control/filter-control.component.ts index 75e10de907..4c002d6871 100644 --- a/apps/web-mzima-client/src/app/shared/components/filter-control/filter-control.component.ts +++ b/apps/web-mzima-client/src/app/shared/components/filter-control/filter-control.component.ts @@ -126,7 +126,7 @@ export class FilterControlComponent implements ControlValueAccessor, OnChanges, } const descendants = this.treeControl.dataNodes; - descendants.map((dataNode) => { + descendants?.map((dataNode) => { if (changes['selectedFields'].currentValue.indexOf(dataNode.id) > -1) { this.checklistSelection.select(dataNode); } else { diff --git a/libs/sdk/src/lib/services/posts.service.ts b/libs/sdk/src/lib/services/posts.service.ts index b649b3c64d..da39d1a2e5 100644 --- a/libs/sdk/src/lib/services/posts.service.ts +++ b/libs/sdk/src/lib/services/posts.service.ts @@ -195,7 +195,10 @@ export class PostsService extends ResourceService { postParams['source[]'] = postParams['source']; // Allocate start and end dates, and remove originals - if (postParams.date?.start) { + if (params.date_before || params.date_after) { + postParams.date_before = params.date_before; + postParams.date_after = params.date_after; + } else if (postParams.date?.start) { postParams.date_after = postParams.date.start; if (postParams.date.end) { postParams.date_before = postParams.date.end;