fix(discover): use added sort in recent requests slider#3202
fix(discover): use added sort in recent requests slider#3202fallenbagel wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughRecentRequestsSlider now fetches requests sorted by ChangesRecent request sorting
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/Discover/RecentRequestsSlider/index.tsx`:
- Line 25: The RecentRequestsSlider query is using sort=added, but the request
listing API only recognizes sort=modified and otherwise falls back to
request.id. Update the backend request sorting logic in server/routes/request.ts
(the request-listing handler) to explicitly map added to request.createdAt, and
add or extend a test covering this sort option before keeping the client change
in Discover/RecentRequestsSlider.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 47f99af5-2639-475f-8e0e-0ee0649a673a
📒 Files selected for processing (1)
src/components/Discover/RecentRequestsSlider/index.tsx
Description
The recent requests slider on the discover page was using
sort=modified, which sorts byupdatedAt. SinceupdatedAtis an@UpdateDateColumnthat gets bumped whenever a request entity is saved, scanner-driven status transitions (availability sync, bulk deletions setting media to DELETED) would silently reorder the slider by floating affected requests to the top.This PR changes the sort to added, which uses
createdAtand reflects actual submission order, consistent with what "Recent Requests" implies.How Has This Been Tested?
(dont need to)
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit