catch sitemap generation error during setup
This commit is contained in:
@@ -50,7 +50,7 @@ module.exports = {
|
|||||||
// Doc: https://axios.nuxtjs.org/usage
|
// Doc: https://axios.nuxtjs.org/usage
|
||||||
'@nuxtjs/axios',
|
'@nuxtjs/axios',
|
||||||
'@nuxtjs/auth',
|
'@nuxtjs/auth',
|
||||||
'@nuxtjs/sitemap'
|
'@nuxtjs/sitemap'
|
||||||
],
|
],
|
||||||
|
|
||||||
sitemap: {
|
sitemap: {
|
||||||
@@ -64,9 +64,13 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
routes: async () => {
|
routes: async () => {
|
||||||
if (config.status === 'READY') {
|
if (config.status === 'READY') {
|
||||||
const Event = require('./server/api/models/event')
|
try {
|
||||||
const events = await Event.findAll({where: { is_visible: true }})
|
const Event = require('./server/api/models/event')
|
||||||
return events.map(e => `/event/${e.slug}`)
|
const events = await Event.findAll({where: { is_visible: true }})
|
||||||
|
return events.map(e => `/event/${e.slug}`)
|
||||||
|
} catch (e) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user