fix(testimonials): group dots by pages on desktop and scroll by two items
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { getPayload } from 'payload'
|
||||
import configPromise from '../src/payload.config'
|
||||
|
||||
async function run() {
|
||||
const payload = await getPayload({ config: configPromise })
|
||||
const pages = await payload.find({ collection: 'pages', limit: 100 }) // fetch all locales?
|
||||
|
||||
const plPages = await payload.find({ collection: 'pages', locale: 'pl', limit: 100 })
|
||||
const dePages = await payload.find({ collection: 'pages', locale: 'de', limit: 100 })
|
||||
|
||||
console.log("=== PL ===")
|
||||
plPages.docs.forEach(page => {
|
||||
page.layout?.forEach(block => {
|
||||
if (block.blockType === 'testimonials' || block.blockType === 'testimonialsGrid') {
|
||||
console.log(`Page: ${page.slug}, Block: ${block.blockType}, Items: ${block.testimonials?.length || 0}`)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
console.log("=== DE ===")
|
||||
dePages.docs.forEach(page => {
|
||||
page.layout?.forEach(block => {
|
||||
if (block.blockType === 'testimonials' || block.blockType === 'testimonialsGrid') {
|
||||
console.log(`Page: ${page.slug}, Block: ${block.blockType}, Items: ${block.testimonials?.length || 0}`)
|
||||
}
|
||||
})
|
||||
})
|
||||
process.exit(0)
|
||||
}
|
||||
run()
|
||||
Reference in New Issue
Block a user