Skip to content

Commit

Permalink
Update endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
José Luis Pereira committed Jun 3, 2022
1 parent aac00ac commit 940f09a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/modules/otus/components/Citation/CitationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ import CitationRow from './CitationRow.vue'
import OtuService from '../../services/OtuService';
const props = defineProps({
taxonId: {
otuId: {
type: [Number, String],
required: true
}
})
const citations = ref([])
watch(() => props.taxonId, async () => {
if (!props.taxonId) { return }
watch(() => props.otuId, async () => {
if (!props.otuId) { return }
citations.value = (await OtuService.getTaxonNameCitations(props.taxonId)).data
citations.value = (await OtuService.getTaxonNameCitations(props.otuId)).data
}, { immediate: true })
</script>
6 changes: 2 additions & 4 deletions src/modules/otus/services/OtuService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { makeAPIRequest } from "@/utils/request"

export default class OtuService {

static getTaxonNameCitations (taxonId) {
return makeAPIRequest.get('/citations.json', {
static getTaxonNameCitations (otuId) {
return makeAPIRequest.get(`/otus/${otuId}/inventory/nomenclature_citations`, {
params: {
citation_object_id: taxonId,
citation_object_type: 'TaxonName',
extend: ['source']
}
})
Expand Down

0 comments on commit 940f09a

Please sign in to comment.