Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Successful in 56s
Build & Deploy / 🏗️ Build (push) Successful in 2m11s
Build & Deploy / 🚀 Deploy (push) Successful in 14s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 4m40s
Build & Deploy / 🔔 Notify (push) Successful in 2s
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
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)',
|
|
excerpt: '',
|
|
content: lexicalContent,
|
|
},
|
|
});
|
|
|
|
console.log('✅ Page updated successfully:', updatedPage.title);
|
|
process.exit(0);
|
|
}
|
|
|
|
run().catch((err) => {
|
|
console.error('❌ Update failed:', err);
|
|
process.exit(1);
|
|
});
|