Skip to content

Commit

Permalink
fix( infinite-scroll amp): handle errors in infinite-scroll amp api r…
Browse files Browse the repository at this point in the history
…esponse (#421)
  • Loading branch information
reddy-vishwanath authored Apr 18, 2024
1 parent 6de24e2 commit 8c24b9b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quintype/framework",
"version": "7.27.1",
"version": "7.27.2-amp-infinite-scroll-errors.0",
"description": "Libraries to help build Quintype Node.js apps",
"main": "index.js",
"engines": {
Expand Down
2 changes: 2 additions & 0 deletions server/amp/handlers/infinite-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const cloneDeep = require("lodash/cloneDeep");

// eslint-disable-next-line consistent-return
async function storyPageInfiniteScrollHandler(req, res, next, { client, config, ...rest }) {
if (!req.query["story-id"]) return res.status(400).send(`Query param "story-id" missing`);

const ampConfig = await config.memoizeAsync("amp-config", async () => await AmpConfig.getAmpConfig(client));
const opts = cloneDeep(rest);
const infiniteScrollSource = get(opts, ["featureConfig", "infiniteScroll", "source"], "collection");
Expand Down

0 comments on commit 8c24b9b

Please sign in to comment.