Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
Update last_updated sort for API expected value
Browse files Browse the repository at this point in the history
Change will allow the UI to append the proper sort string that the API is expecting. Under [email protected]\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.
  • Loading branch information
Michael-Hanley authored Feb 28, 2019
1 parent 19edece commit 17fdb1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 17fdb1b

Please sign in to comment.