Skip to content

Commit

Permalink
Issue/hitide profile 45 - fix history not showing up (#38)
Browse files Browse the repository at this point in the history
* issue/hitide-profile-45: fixed parsing error for history

* /deploy sit

---------

Co-authored-by: jbyrne <[email protected]>
  • Loading branch information
jbyrne6 and jbyrne authored Jun 17, 2024
1 parent 94623c5 commit 759f044
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
### Removed
### Fixed
- issue-45: Fixed history not showing up.


## [4.10.1]
Expand Down
10 changes: 9 additions & 1 deletion server/util/history-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@ function convertDbJobToJsJob(dbJob) {
}

if(jsonProperties[jsKey]) {
value = JSON.parse(value);
// if string is not valid json, convert it to valid json.
try {
value = JSON.parse(value);
} catch(error) {
if(dbKey === 'download_urls') {
value = ['https://harmony.earthdata.nasa.gov/jobs/' + dbJob['token']]
}
}

}

jsJob[jsKey] = value;
Expand Down

0 comments on commit 759f044

Please sign in to comment.