a little cleanup on new rss feeds

This commit is contained in:
keyan 2023-05-04 15:05:07 -05:00
parent b59f277a3b
commit 5e6e6a18e6
3 changed files with 5 additions and 5 deletions

View File

@ -49,11 +49,11 @@ function generateRssFeed (items) {
} }
export default function getGetRssServerSideProps (query, variables = null) { export default function getGetRssServerSideProps (query, variables = null) {
return async function ({ req, res }) { return async function ({ req, res, params }) {
const emptyProps = { props: {} } // to avoid server side warnings const emptyProps = { props: {} } // to avoid server side warnings
const client = await getSSRApolloClient(req) const client = await getSSRApolloClient(req)
const { error, data: { items: { items } } } = await client.query({ const { error, data: { items: { items } } } = await client.query({
query, variables query, variables: { ...params, ...variables }
}) })
if (!items || error) return emptyProps if (!items || error) return emptyProps

View File

@ -6,4 +6,4 @@ export default function RssFeed () {
return null return null
} }
export const getServerSideProps = getGetRssServerSideProps(ITEMS); export const getServerSideProps = getGetRssServerSideProps(ITEMS)

View File

@ -6,4 +6,4 @@ export default function RssFeed () {
return null return null
} }
export const getServerSideProps = ({ req, res, params }) => getGetRssServerSideProps(ITEMS, { sub: params.sub })({ req, res }); export const getServerSideProps = getGetRssServerSideProps(ITEMS)