From 91bee7cebbce576de2893217ff24513eb9e3fe5e Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Thu, 3 Oct 2024 13:03:48 -0300 Subject: [PATCH] chore: change sort key to timeOfContact (contacts) and createdAt (cases) --- .../hrm-search-config/generateElasticsearchQuery.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hrm-domain/packages/hrm-search-config/generateElasticsearchQuery.ts b/hrm-domain/packages/hrm-search-config/generateElasticsearchQuery.ts index d1b6c2c8..e769f4b3 100644 --- a/hrm-domain/packages/hrm-search-config/generateElasticsearchQuery.ts +++ b/hrm-domain/packages/hrm-search-config/generateElasticsearchQuery.ts @@ -386,8 +386,8 @@ const generateContactsQuery = ({ }, sort: searchParameters.searchTerm.length === 0 - ? [{ updatedAt: 'desc' }] - : ['_score', { updatedAt: 'desc' }], + ? [{ timeOfContact: 'desc' }] + : ['_score', { timeOfContact: 'desc' }], min_score: MIN_SCORE, from: pagination.start, size: pagination.limit, @@ -501,8 +501,8 @@ const generateCasesQuery = ({ }, sort: searchParameters.searchTerm.length === 0 - ? [{ updatedAt: 'desc' }] - : ['_score', { updatedAt: 'desc' }], + ? [{ createdAt: 'desc' }] + : ['_score', { createdAt: 'desc' }], min_score: MIN_SCORE, from: pagination.start, size: pagination.limit,