From 17fdb1b8cadb9fc2865e7640b213a5756953a32b Mon Sep 17 00:00:00 2001 From: Michael Hanley Date: Thu, 28 Feb 2019 10:12:36 -0800 Subject: [PATCH] Update last_updated sort for API expected value Change will allow the UI to append the proper sort string that the API is expecting. Under node_modules@code.gov\code-gov-adapter\libs\elasticsearch\config\index.js in the API, the sort mapping is looking for "lastModified" in order to sort by date.lastModified. --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 685b122..c1a5b51 100644 --- a/src/index.js +++ b/src/index.js @@ -236,8 +236,8 @@ class CodeGovAPIClient { const sortNormalized = sort.toLowerCase().trim() if (sortNormalized === 'a-z' || sortNormalized === 'name__asc') { url += `&sort=name__asc` - } else if (sortNormalized === 'last_update') { - url += `&sort=last_updated` + } else if (sortNormalized === 'last_updated') { + url += `&sort=lastModified__desc` } else if (sortNormalized === 'data_quality') { console.log("don't have to add data_quality as sort parameter because this is on by default") }