feat: manage press kit download via payload
This commit is contained in:
@@ -32,10 +32,11 @@ async function main() {
|
||||
const page = pageResult.docs[0]
|
||||
if (!page) throw new Error('Press index page not found. Expected spaPath=/presse or slug=presse/press.')
|
||||
|
||||
const [heroImage, eventFallbackImage, newsFallbackImage] = await Promise.all([
|
||||
const [heroImage, eventFallbackImage, newsFallbackImage, kitFile] = await Promise.all([
|
||||
mediaByFilename(payload, pressIndexContent.hero.imageFilename),
|
||||
mediaByFilename(payload, pressIndexContent.events.collectionFallbackImageFilename),
|
||||
mediaByFilename(payload, pressIndexContent.news.collectionFallbackImageFilename),
|
||||
mediaByFilename(payload, pressIndexContent.downloads.kitDownloadName),
|
||||
])
|
||||
const { imageFilename: _heroFilename, ...heroContent } = pressIndexContent.hero
|
||||
const { collectionFallbackImageFilename: _eventFallbackFilename, ...eventsContent } = pressIndexContent.events
|
||||
@@ -61,6 +62,10 @@ async function main() {
|
||||
...newsContent,
|
||||
collectionFallbackImage: newsFallbackImage,
|
||||
},
|
||||
downloads: {
|
||||
...pressIndexContent.downloads,
|
||||
kitFile,
|
||||
},
|
||||
},
|
||||
} as never,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user