catch sitemap generation error during setup
This commit is contained in:
parent
cf71d17f2f
commit
798ef3a7d8
1 changed files with 8 additions and 4 deletions
|
@ -50,7 +50,7 @@ module.exports = {
|
|||
// Doc: https://axios.nuxtjs.org/usage
|
||||
'@nuxtjs/axios',
|
||||
'@nuxtjs/auth',
|
||||
'@nuxtjs/sitemap'
|
||||
'@nuxtjs/sitemap'
|
||||
],
|
||||
|
||||
sitemap: {
|
||||
|
@ -64,9 +64,13 @@ module.exports = {
|
|||
],
|
||||
routes: async () => {
|
||||
if (config.status === 'READY') {
|
||||
const Event = require('./server/api/models/event')
|
||||
const events = await Event.findAll({where: { is_visible: true }})
|
||||
return events.map(e => `/event/${e.slug}`)
|
||||
try {
|
||||
const Event = require('./server/api/models/event')
|
||||
const events = await Event.findAll({where: { is_visible: true }})
|
||||
return events.map(e => `/event/${e.slug}`)
|
||||
} catch (e) {
|
||||
return []
|
||||
}
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue