Skip to content

Conversation

@420coupe
Copy link
Contributor

@420coupe 420coupe commented Jan 23, 2026

Summary

What — What changes are introduced in this PR?

Docs update to digital product recipe

Why — Why are these changes relevant or necessary?

Digital product table data was not updating on pagination, kept using defaults 20, 0.

How — How have these changes been implemented?

Updated docs.

Testing — How have these changes been tested, or how can the reviewer test the feature?

Tested locally and on prod instances to confirm table data is being updated.


Examples

export const GET = async (
  req: AuthenticatedMedusaRequest,
  res: MedusaResponse
) => {
  const { 
    fields, 
    limit = Number(req.query.limit) || 20,
    offset = Number(req.query.offset) || 0,
  } = req.validatedQuery || {}
  const query = req.scope.resolve(ContainerRegistrationKeys.QUERY)

  const { 
    data: digitalProducts,
    metadata: { count, take, skip } = {},
  } = await query.graph({
    entity: "digital_product",
    fields: [
      "*",
      "medias.*",
      "product_variant.*",
      ...(fields || []),
    ],
    pagination: {
      skip: offset,
      take: limit,
    },
  })

  res.json({
    digital_products: digitalProducts,
    count,
    limit: take,
    offset: skip,
  })
}

Checklist

Please ensure the following before requesting a review:

  • I have added a changeset for this PR
    • Every non-breaking change should be marked as a patch
    • To add a changeset, run yarn changeset and follow the prompts
  • The changes are covered by relevant tests
  • I have verified the code works as intended locally
  • I have linked the related issue(s) if applicable

Additional Context

PR to update examples repo medusajs/examples#96


Note

Updates the digital products example to respect pagination params.

  • In recipes/digital-products/examples/standard/page.mdx, the GET /admin/digital-products handler now derives limit and offset from req.query (Number(req.query.limit)||20, Number(req.query.offset)||0) so table data updates when paginating.

Written by Cursor Bugbot for commit 65fe9b6. This will update automatically on new commits. Configure here.

@420coupe 420coupe requested a review from a team as a code owner January 23, 2026 17:31
@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2026

⚠️ No Changeset found

Latest commit: 65fe9b6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 23, 2026

@420coupe is attempting to deploy a commit to the medusajs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant