Skip to content

Commit

Permalink
Replace deprecated ncbi taxonomy api with newer version, show common …
Browse files Browse the repository at this point in the history
…name if available
  • Loading branch information
milot-mirdita committed Aug 18, 2023
1 parent f718be0 commit 857b863
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/TaxonomyAutocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ export default {
this.loading = true;
// make a new axios instance to not leak the electron access token
const axios = create();
axios.get("https://api.ncbi.nlm.nih.gov/datasets/v1/genome/taxon_suggest/" + encodeURIComponent(name) + "?tax_rank_filter=higher_taxon")
axios.get("https://api.ncbi.nlm.nih.gov/datasets/v2alpha/taxonomy/taxon_suggest/" + encodeURIComponent(name) + "?tax_rank_filter=higher_taxon")
.then(response => {
if (response.status == 200 && response.data.hasOwnProperty("sci_name_and_ids")) {
this.items = response.data.sci_name_and_ids.map((el) => {
if (el.common_name) {
el.sci_name += " (" + el.common_name + ")";
}
return { text: el.sci_name, value: el.tax_id }
});
}
Expand Down

0 comments on commit 857b863

Please sign in to comment.