Skip to content

Commit

Permalink
Use dataset doi instead of name when processsing data. Fix an issue w…
Browse files Browse the repository at this point in the history
…hen updated is not defined in SciCrunch response.
  • Loading branch information
alan-wu committed Sep 6, 2022
1 parent 14a3a58 commit 3310b16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/SidebarContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export default {
}
data.results.forEach(element => {
// match the scicrunch result with algolia result
let i = this.results.findIndex(res=> res.name === element.name)
let i = this.results.findIndex(res => element.doi ? element.doi.includes(res.doi) : false )
// Assign scicrunch results to the object
Object.assign(this.results[i], element)
// Assign the attributes that need some processing
Expand All @@ -322,7 +322,7 @@ export default {
numberSubjects: element.subjectSize
? parseInt(element.subjectSize)
: 0,
updated: element.updated[0].timestamp.split("T")[0],
updated: (element.updated && element.updated.length) > 0 ? element.updated[0].timestamp.split("T")[0] : "",
url: element.uri[0],
datasetId: element.dataset_identifier,
datasetRevision: element.dataset_revision,
Expand Down

0 comments on commit 3310b16

Please sign in to comment.