yarn package upgrades, ssr update
All checks were successful
deploy to production / deploy (push) Successful in 45s
All checks were successful
deploy to production / deploy (push) Successful in 45s
This commit is contained in:
@@ -1,19 +1,35 @@
|
||||
const publishedFilter = {
|
||||
$or: [
|
||||
{ publishDate: { $exists: false } },
|
||||
{ publishDate: null },
|
||||
{
|
||||
publishDate: { $lte: { $date: new Date().toISOString() } },
|
||||
// publishDate: { $lte: new Date() },
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const apiSsrBaseURL = "http://localhost:8080/api/v1/_/demo/"
|
||||
|
||||
module.exports = {
|
||||
ssrValidatePath: function (path) {
|
||||
publishedFilter,
|
||||
apiSsrBaseURL,
|
||||
ssrValidatePath: function (/** @type {string} */ path) {
|
||||
// validate if path ssr rendering is ok, -1 = NOTFOUND, 0 = NO SSR, 1 = SSR
|
||||
// pe. use context.readCollection("product", {filter: {path: path}}) ... to validate dynamic urls
|
||||
|
||||
// / is de home
|
||||
if (path == "/") return 1
|
||||
// // / is de home
|
||||
// if (path == "/") return 1
|
||||
|
||||
// all other sites are in db
|
||||
path = path?.replace(/^\//, "")
|
||||
// // all other sites are in db
|
||||
// path = path?.replace(/^\//, "")
|
||||
|
||||
// filter for path or alternativePaths
|
||||
const resp = context.db.find("content", {
|
||||
filter: {
|
||||
$or: [{ path }, { "alternativePaths.path": path }],
|
||||
$and: [{ $or: [{ path }, { "alternativePaths.path": path }] }, publishedFilter],
|
||||
},
|
||||
|
||||
selector: { _id: 1 },
|
||||
})
|
||||
if (resp && resp.length) {
|
||||
@@ -23,5 +39,5 @@ module.exports = {
|
||||
// not found
|
||||
return -1
|
||||
},
|
||||
ssrAllowedAPIEndpoints: ["content", "medialib"],
|
||||
ssrPublishCheckCollections: ["content"],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user