Add related videos to api endpoints

This commit is contained in:
Sam Carlton 2022-04-26 16:44:35 -05:00
parent 275ab89f00
commit 744b7551a6

View file

@ -217,7 +217,16 @@ class BuildLists {
const endpointPath = `./static/api${endpoint}.json`
const endpointDirectory = dirname(endpointPath)
// Add related videos
if ( this.shouldHaveRelatedVideos( listEntry ) ) {
listEntry.relatedVideos = videosRelatedToApp( listEntry, this.lists.video ).map(video => {
// console.log('video', video)
return {
...video,
endpoint: `${getAppEndpoint(listEntry)}/benchmarks#${video.id}`
}
})
}
// console.log(`Saving endpoint "${endpoint}" to "${endpointPath}"`)