Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

0 result check soorten register, resolves #64, fixes #65.

  • Loading branch information...
rasvaan committed Nov 21, 2016
1 parent 5060b49 commit 247f1814321a434dbc0c3dc41a1aa359767a4700
Showing with 7 additions and 0 deletions.
  1. +3 −0 api_calls
  2. +4 −0 src/middlewares/soorten-register.js
@@ -4,4 +4,7 @@ http://api.biodiversitydata.nl/v0/multimedia/search/?genus=pica&species=pica&sou
############### soorten registers scientific species query white belied sea eagle ###############
http://api.biodiversitydata.nl/v0/multimedia/search/?genus=haliaeetus&species=leucogaster&sourceSystem=Naturalis - Nederlands Soortenregister

############### soorten registers scientific species query white-bellied goshwak (0 results)###############
http://api.biodiversitydata.nl/v0/multimedia/search/?genus=accipiter&species=haplochrous&sourceSystem=Naturalis - Nederlands Soortenregister

############### natuurbeelden api call ###############
@@ -63,6 +63,9 @@ module.exports = {
const IMAGE = 'dctype:Image';
let aggregations = [];

// there might be no results
if (!data.searchResults) return aggregations;

for (let i=0; i<data.searchResults.length; i++) {
const result = data.searchResults[i].result;
const uri = `http://www.nederlandsesoorten.nl/nsr/concept/${result.associatedTaxonReference}/${i}`
@@ -78,6 +81,7 @@ module.exports = {
aggregations.push(aggregation);
}


return aggregations;
},
createCulturalObject: function(result, uri) {

0 comments on commit 247f181

Please sign in to comment.
You can’t perform that action at this time.