fix(pdf): resolve crash in yoga engine caused by absolute positioning and empty paragraphs
This commit is contained in:
36
scripts/update-cms-avb.ts
Normal file
36
scripts/update-cms-avb.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { getPayload } from 'payload';
|
||||
import configPromise from '../payload.config';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const filename = fileURLToPath(import.meta.url);
|
||||
const dirname = path.dirname(filename);
|
||||
|
||||
async function run() {
|
||||
process.env.PAYLOAD_MIGRATE = 'false';
|
||||
process.env.PAYLOAD_MIGRATE_SKIP_PROMPTS = 'true';
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
|
||||
console.log('📖 Reading lexical_avb.json...');
|
||||
const lexicalContent = JSON.parse(fs.readFileSync(path.resolve(dirname, '../lexical_avb.json'), 'utf8'));
|
||||
|
||||
console.log('🚀 Updating AGB page (ID 6) to AVB...');
|
||||
|
||||
const updatedPage = await payload.update({
|
||||
collection: 'pages',
|
||||
id: 6,
|
||||
data: {
|
||||
title: 'Allgemeine Verkaufsbedingungen (AVB)',
|
||||
content: lexicalContent,
|
||||
},
|
||||
});
|
||||
|
||||
console.log('✅ Page updated successfully:', updatedPage.title);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
run().catch((err) => {
|
||||
console.error('❌ Update failed:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user