refactor(cms): remove obsolete page fields
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user