handle all not found errors

This commit is contained in:
Amir Mohamadi
2021-12-31 17:01:17 +03:30
parent 5c07791225
commit 064d642b7e
47 changed files with 3386 additions and 3238 deletions
+12 -8
View File
@@ -106,15 +106,19 @@ export default {
title: this.staticData.hero
}
},
async asyncData({$axios, store}) {
const products = await $axios.get(`/api/public/products`)
const productCategories = await $axios.get(`/api/public/productCategories`)
const catalog = await $axios.get('/api/public/catalog')
async asyncData({$axios, store, error}) {
try {
const products = await $axios.get(`/api/public/products`)
const productCategories = await $axios.get(`/api/public/productCategories`)
const catalog = await $axios.get('/api/public/catalog')
return {
products: products.data,
productCategories: productCategories.data,
catalog: catalog.data
return {
products: products.data,
productCategories: productCategories.data,
catalog: catalog.data
}
} catch (e) {
error({status: 404, message: 'There is a problem here'})
}
}
}