fix: resolve contact form placeholders, restore process block layout, and fix testimonials carousel scroll logic
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { getPayload } from 'payload'
|
||||
import configPromise from '../src/payload.config'
|
||||
|
||||
async function run() {
|
||||
const payload = await getPayload({ config: configPromise })
|
||||
const addressDE = "Vom Kunden zu bestätigen";
|
||||
const hoursDE = "Mo-Fr: 9:00 - 17:00\nNach vorheriger Terminvereinbarung";
|
||||
|
||||
for (const slug of ['kontakt', 'terminvereinbarung']) {
|
||||
const pages = await payload.find({ collection: 'pages', locale: 'de', where: { slug: { equals: slug } } });
|
||||
if (pages.docs.length > 0) {
|
||||
const doc = pages.docs[0];
|
||||
const newLayout = doc.layout?.map((b: any) => {
|
||||
if (b.blockType === 'contactInfo' || b.blockType === 'contactSection') {
|
||||
b.address = addressDE;
|
||||
b.hours = hoursDE;
|
||||
}
|
||||
return b;
|
||||
});
|
||||
await payload.update({
|
||||
collection: 'pages',
|
||||
id: doc.id,
|
||||
locale: 'de',
|
||||
data: { layout: newLayout }
|
||||
});
|
||||
console.log('Updated ' + slug);
|
||||
}
|
||||
}
|
||||
process.exit(0);
|
||||
}
|
||||
run()
|
||||
Reference in New Issue
Block a user