Tiny fixes + start pre-rendering

This commit is contained in:
Julien Nahum 2023-12-22 14:59:42 +01:00
parent 5a07064eee
commit 57ba033a91
7 changed files with 782 additions and 848 deletions

View File

@ -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)

View File

@ -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}
})

View File

@ -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

View File

@ -11,12 +11,6 @@
],
"license": "MIT",
"type": "project",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/JhumanJ/laravel-notion-api.git"
}
],
"require": {
"php": "^8.2",
"ext-json": "*",

1603
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,6 @@
"axios": "^0.21.1",
"chart.js": "^4.4.0",
"clone-deep": "^4.0.1",
"crisp-sdk-web": "^1.0.21",
"date-fns": "^2.28.0",
"debounce": "^1.2.1",
"fuse.js": "^6.4.6",