handle all not found errors
This commit is contained in:
+13
-9
@@ -42,7 +42,7 @@
|
||||
<div class="col-12">
|
||||
<p>{{ staticData.s1_2.t2 }}</p>
|
||||
<p>{{ staticData.s1_2.t3 }}</p>
|
||||
<nuxt-link :to="{name: 'lang-about',params: {lang: $route.params.lang}}" class="btn btn-primary">{{ staticData.s1_2.link }}</nuxt-link>
|
||||
<nuxt-link :to="{name: 'lang-about',params: {lang: $route.params.lang},hash: '#history_timeline'}" class="btn btn-primary">{{ staticData.s1_2.link }}</nuxt-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -247,15 +247,19 @@ export default {
|
||||
title: this.staticData.title
|
||||
}
|
||||
},
|
||||
async asyncData({$axios}) {
|
||||
const slider = await $axios.get('/api/public/slider')
|
||||
const favoriteProducts = await $axios.get(`/api/public/favoriteProducts`)
|
||||
const catalog = await $axios.get('/api/public/catalog')
|
||||
async asyncData({$axios, error}) {
|
||||
try {
|
||||
const slider = await $axios.get('/api/public/slider')
|
||||
const favoriteProducts = await $axios.get(`/api/public/favoriteProducts`)
|
||||
const catalog = await $axios.get('/api/public/catalog')
|
||||
|
||||
return {
|
||||
slider: slider.data,
|
||||
favoriteProducts: favoriteProducts.data,
|
||||
catalog: catalog.data
|
||||
return {
|
||||
slider: slider.data,
|
||||
favoriteProducts: favoriteProducts.data,
|
||||
catalog: catalog.data
|
||||
}
|
||||
} catch (e) {
|
||||
error({status: 404, message: 'There is a problem here'})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user