Skip to content

Commit

Permalink
Merge pull request #47 from dailybruin/bryson/fix-all-stories
Browse files Browse the repository at this point in the history
Bryson/fix all stories
  • Loading branch information
kaylynphan authored May 10, 2023
2 parents ef420cf + db22397 commit 5aeb33a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/pages/all.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,17 @@ const AllStories = ({ data }) => {
let year = '20' + term.substring(term.length - 2, term.length)
return {
quarter: season + ' ' + year,
stories: issue.articles.map(slug => {
const curredge = data.allPrimeArticle.edges.filter(edge => {
return edge.node.slug === slug
})[0]
return curredge.node
}),
stories: issue.articles
.map(slug => {
const curredge = data.allPrimeArticle.edges.filter(edge => {
return edge.node.slug === slug
})[0]
return curredge.node
})
.filter(node => {
// just in case something is undefined filter so page doesn't crash
return !(node === undefined)
}),
}
})
return (
Expand Down

0 comments on commit 5aeb33a

Please sign in to comment.