Tiny fixes + start pre-rendering
This commit is contained in:
1
client/composables/stores/useContentStore.js
vendored
1
client/composables/stores/useContentStore.js
vendored
@@ -26,6 +26,7 @@ export const useContentStore = (mapKey = 'id') => {
|
||||
}
|
||||
|
||||
function save(items) {
|
||||
if (!items) return
|
||||
if (!Array.isArray(items)) items = [items]
|
||||
items.forEach((item) => {
|
||||
content.value.set(item[mapKey], item)
|
||||
|
||||
@@ -12,14 +12,16 @@ if (opnformConfig.sentry_dsn) {
|
||||
modules.push('@nuxtjs/sentry')
|
||||
}
|
||||
|
||||
const cachedRoutes = [
|
||||
const preRenderedRoutes = [
|
||||
'/',
|
||||
'/ai-form-builder',
|
||||
'/login',
|
||||
'/register',
|
||||
'/privacy-policy',
|
||||
'/terms-conditions',
|
||||
].reduce((acc, curr) => (acc[curr] = {swr: 60 * 60}, acc), {});
|
||||
// '/privacy-policy',
|
||||
// '/terms-conditions',
|
||||
'/templates',
|
||||
'/templates/*',
|
||||
].reduce((acc, curr) => (acc[curr] = {prerender: true}, acc), {});
|
||||
|
||||
export default defineNuxtConfig({
|
||||
devtools: {enabled: true},
|
||||
@@ -55,8 +57,5 @@ export default defineNuxtConfig({
|
||||
},
|
||||
'~/components',
|
||||
],
|
||||
routeRules: { ... cachedRoutes},
|
||||
devServer: {
|
||||
https: true,
|
||||
}
|
||||
routeRules: { ... preRenderedRoutes}
|
||||
})
|
||||
|
||||
2
client/stores/templates.js
vendored
2
client/stores/templates.js
vendored
@@ -55,7 +55,7 @@ export const loadAllTemplates = async (store, options={}) => {
|
||||
if (!store.allLoaded) {
|
||||
store.startLoading()
|
||||
store.initTypesAndIndustries()
|
||||
const {data} = await fetchAllTemplates(options)
|
||||
const {data,error} = await fetchAllTemplates(options)
|
||||
store.set(data.value)
|
||||
store.stopLoading()
|
||||
store.allLoaded = true
|
||||
|
||||
Reference in New Issue
Block a user