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

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

View File

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

View File

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