handle all not found errors
This commit is contained in:
@@ -107,10 +107,14 @@ export default {
|
||||
title: this.staticData.hero
|
||||
}
|
||||
},
|
||||
async asyncData({$axios}) {
|
||||
const projects = await $axios.get(`/api/public/projects`)
|
||||
return {
|
||||
projects: projects.data
|
||||
async asyncData({$axios, error}) {
|
||||
try {
|
||||
const projects = await $axios.get(`/api/public/projects`)
|
||||
return {
|
||||
projects: projects.data
|
||||
}
|
||||
} catch (e) {
|
||||
error({status: 404, message: 'There is a problem here'})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user