Skip to content

Commit

Permalink
Catch error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Mar 19, 2025
1 parent a905390 commit a9e8ee3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/components/Autocomplete/Autocomplete.global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ watch(typed, (newVal) => {
isSearching.value = false
list.value = data
})
.catch(() => {})
}, delay)
} else {
list.value = []
Expand Down
1 change: 1 addition & 0 deletions src/components/Gallery/useGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function useGallery({ props }) {
props.depictionId.indexOf(b.id)
)
})
.catch(() => {})
}
},
{ immediate: true }
Expand Down
17 changes: 10 additions & 7 deletions src/components/ProjectStats.global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ function filterStats(currentStats) {
}
onMounted(() => {
makeAPIRequest.get('/stats').then((response) => {
const data = Object.entries(response.data.data).map(([key, value]) => [
key.toLowerCase(),
value.toLocaleString()
])
makeAPIRequest
.get('/stats')
.then((response) => {
const data = Object.entries(response.data.data).map(([key, value]) => [
key.toLowerCase(),
value.toLocaleString()
])
stats.value.data = data
})
stats.value.data = data
})
.catch(() => {})
})
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ watch(
.then(({ data }) => {
taxonomy.value = data
})
.catch(() => {})
.finally(() => (isLoading.value = false))
},
{ immediate: true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ function loadOTUs(geojson) {
list.value = data
isTableVisible.value = true
})
.catch(() => {})
.finally((_) => {
isLoading.value = false
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export const useDistributionStore = defineStore('distributionStore', {
},

loadCachedMap(mapId) {
TaxonWorks.getCachedMap(mapId, { signal: this.controller.signal }).then(
(response) => {
TaxonWorks.getCachedMap(mapId, { signal: this.controller.signal })
.then((response) => {
this.distribution.cachedMap = response.data
}
)
})
.catch(() => {})
},

async getAggregateShape(otuId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ watch(
useOtuPageRequest('panel:typeMaterial', () =>
TaxonWorks.getOtuTypeMaterial(props.otuId)
).then(({ data }) => {
typeMaterials.value = data.type_materials_catalog_labels.sort(
(a, b) =>
SPECIMEN_TYPES.indexOf(a.type_type) -
SPECIMEN_TYPES.indexOf(b.type_type)
)
})
)
.then(({ data }) => {
typeMaterials.value = data.type_materials_catalog_labels.sort(
(a, b) =>
SPECIMEN_TYPES.indexOf(a.type_type) -
SPECIMEN_TYPES.indexOf(b.type_type)
)
})
.catch(() => {})
},
{ immediate: true }
)
Expand Down

0 comments on commit a9e8ee3

Please sign in to comment.