refactor(cms): remove obsolete page fields

This commit is contained in:
syntaxbullet
2026-07-31 14:51:11 +02:00
parent 8dc17c0fea
commit ab47571139
22 changed files with 613 additions and 1424 deletions

View File

@@ -41,25 +41,15 @@ async function main() {
const page = pageResult.docs[0]
if (!page) throw new Error('About page not found. Expected spaPath=/der-bmp or slug=der-bmp/about.')
const [heroImage, prizeImage, mittelstandImage, fallbackWinnerImage, winnerResult] = await Promise.all([
const [heroImage, prizeImage, mittelstandImage] = await Promise.all([
mediaByFilename(payload, aboutContent.hero.backgroundImageFilename),
mediaByFilename(payload, aboutContent.prize.imageFilename),
mediaByFilename(payload, aboutContent.mittelstand.imageFilename),
mediaByFilename(payload, aboutContent.highlights.fallbackImageFilename),
payload.find({
collection: 'preistraeger',
limit: 8,
pagination: false,
draft: true,
overrideAccess: true,
where: { year: { equals: aboutContent.highlights.year } },
}),
])
const { backgroundImageFilename: _heroFilename, ...heroContent } = aboutContent.hero
const { imageFilename: _prizeFilename, ...prizeContent } = aboutContent.prize
const { imageFilename: _mittelstandFilename, ...mittelstandContent } = aboutContent.mittelstand
const { fallbackImageFilename: _highlightFallbackFilename, ...highlightsContent } = aboutContent.highlights
const testimonials = await testimonialsWithImages(payload)
await payload.update({
@@ -84,11 +74,6 @@ async function main() {
image: mittelstandImage,
body: aboutContent.mittelstand.body.map((text) => ({ text })),
},
highlights: {
...highlightsContent,
fallbackImage: fallbackWinnerImage,
selectedWinners: winnerResult.docs.map((winner) => winner.id),
},
testimonials,
},
} as never,