28 lines
867 B
JavaScript
28 lines
867 B
JavaScript
|
|
import "../../components/main.js"
|
||
|
|
import LatestEpisodes from "../../components/latestepisodes.js"
|
||
|
|
import Layout from "../../components/main.js"
|
||
|
|
|
||
|
|
export async function getStaticProps(context) {
|
||
|
|
const secres = await fetch(`http://localhost:8000/api/sections`)
|
||
|
|
const secdata = await secres.json()
|
||
|
|
|
||
|
|
const podcastres = await fetch(`http://localhost:8000/api/podcasts/bystatus/0`)
|
||
|
|
const podcastdata = await podcastres.json()
|
||
|
|
|
||
|
|
return {
|
||
|
|
props: { sections : secdata, podcastdata }, // will be passed to the page component as props
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const PodcastArchived = ({sections, podcastdata}) => (
|
||
|
|
<Layout sections={sections}>
|
||
|
|
<LatestEpisodes></LatestEpisodes>
|
||
|
|
<h1>Archived Podcasts</h1>
|
||
|
|
{podcastdata.shows.map((podcast) => (
|
||
|
|
<h1>{podcast.title}</h1>
|
||
|
|
))}
|
||
|
|
|
||
|
|
</Layout>
|
||
|
|
)
|
||
|
|
|
||
|
|
export default PodcastArchived
|