Skip to content

Fix self-service asset pagination counts#2038

Merged
DonKoko merged 2 commits intomainfrom
codex/fix-empty-pages-in-asset-list
Sep 17, 2025
Merged

Fix self-service asset pagination counts#2038
DonKoko merged 2 commits intomainfrom
codex/fix-empty-pages-in-asset-list

Conversation

@carlosvirreira
Copy link
Copy Markdown
Contributor

Summary

  • add an availableToBookOnly option to asset queries so self-service pagination uses aligned counts
  • thread the self-service flag through the asset loaders and advanced SQL where clause to enforce availableToBook = true

Testing

  • npm run lint

https://chatgpt.com/codex/tasks/task_b_68c9a9823a208326874ba8d6363635ad

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
shelf-docs Ignored Ignored Preview Sep 17, 2025 10:46am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses pagination count misalignment for self-service users by ensuring asset queries filter for availableToBook = true at the database level rather than in application code. This ensures that pagination counts accurately reflect the filtered results.

Key Changes

  • Adds availableToBookOnly parameter to asset query functions to enforce database-level filtering for self-service users
  • Removes client-side filtering that was causing pagination count discrepancies
  • Threads the self-service role flag through the asset loading pipeline

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/modules/asset/service.server.ts Adds availableToBookOnly parameter to asset query functions and applies database-level filtering
app/modules/asset/query.server.ts Updates SQL generation to include availableToBook = true condition when needed
app/modules/asset/data.server.ts Removes client-side filtering and passes self-service flag to query functions

@DonKoko DonKoko merged commit dbc16cf into main Sep 17, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants