Skip to content

fix: adjust props on get sponsor user request table function#792

Open
tomrndom wants to merge 1 commit intomasterfrom
fix/sponsor-user-request-pagination
Open

fix: adjust props on get sponsor user request table function#792
tomrndom wants to merge 1 commit intomasterfrom
fix/sponsor-user-request-pagination

Conversation

@tomrndom
Copy link

@tomrndom tomrndom commented Feb 13, 2026

ref: https://app.clickup.com/t/86b82fgft

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

Release Notes

No user-facing changes in this release. This is a maintenance update to internal code structure with no impact on functionality or user experience.

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom requested a review from smarcet February 13, 2026 21:51
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

Three internal call sites of the getRequests prop in the RequestTable component were updated to include an additional null first argument across pagination change, per-page change, and sort operations.

Changes

Cohort / File(s) Summary
RequestTable prop calls
src/pages/sponsors/sponsor-users-list-page/components/request-table.js
Added null as the first argument to three getRequests calls in handleRequestsPageChange, handlePerPageChange, and handleRequestsSort methods.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested reviewers

  • smarcet

Poem

🐰 A null prepended with care,
Three calls now stand aligned,
Through pagination and pages fair,
New arguments entwined!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adjusting props on the getRequests function for the sponsor user request table to add a null first parameter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/sponsor-user-request-pagination

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/pages/sponsors/sponsor-users-list-page/components/request-table.js (1)

30-34: ⚠️ Potential issue | 🟠 Major

Inconsistent getRequests() call - missing arguments.

This call to getRequests() passes no arguments, while the other three call sites were updated to pass (null, term, page, perPage, order, orderDir). After a delete operation, this likely should refresh the current page with proper pagination state.

🐛 Proposed fix to align with updated signature
 const handleRequestDelete = (itemId) => {
+  const { currentPage, perPage, order, orderDir } = requests;
   onRequestDelete(itemId).then(() => {
-    getRequests();
+    getRequests(null, term, currentPage, perPage, order, orderDir);
   });
 };
🤖 Fix all issues with AI agents
In `@src/pages/sponsors/sponsor-users-list-page/components/request-table.js`:
- Around line 11-24: The deletion handler currently calls getRequests() with no
arguments which clears the current search/pagination/sort state; update the
deletion flow to call getRequests(null, term, requests.currentPage,
requests.perPage, requests.order, requests.orderDir) so it preserves the current
term and requests state (keep null for companyId as used in
handleRequestsPageChange/handlePerPageChange/handleRequestsSort) and ensure you
reference the existing requests and term variables when invoking getRequests.

Comment on lines 11 to 24
const handleRequestsPageChange = (page) => {
const { perPage, order, orderDir } = requests;
getRequests(term, page, perPage, order, orderDir);
getRequests(null, term, page, perPage, order, orderDir);
};

const handlePerPageChange = (newPerPage) => {
const { order, orderDir } = requests;
getRequests(term, 1, newPerPage, order, orderDir);
getRequests(null, term, 1, newPerPage, order, orderDir);
};

const handleRequestsSort = (key, dir) => {
const { currentPage, perPage } = requests;
getRequests(term, currentPage, perPage, key, dir);
getRequests(null, term, currentPage, perPage, key, dir);
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for getRequests function/action definition across the repository

echo "=== Searching for getRequests definition ==="
rg -n 'getRequests\s*=' --type js -A 3

echo ""
echo "=== Searching for getRequests as export ==="
rg -n 'export.*getRequests' --type js -B 2 -A 5

echo ""
echo "=== Checking the request-table.js file to see all getRequests calls ==="
cat -n src/pages/sponsors/sponsor-users-list-page/components/request-table.js | head -40

echo ""
echo "=== Searching for where request-table.js is used and how getRequests is passed ==="
rg -n 'request-table' --type js -A 5 -B 5 | head -50

Repository: fntechgit/summit-admin

Length of output: 3185


🏁 Script executed:

#!/bin/bash
# Search for getSponsorUserRequests function definition

echo "=== Searching for getSponsorUserRequests definition ==="
rg -n 'getSponsorUserRequests' --type js -A 10

echo ""
echo "=== Check sponsor-users-actions.js file ==="
fd sponsor-users-actions --type js -exec cat -n {} \;

Repository: fntechgit/summit-admin

Length of output: 11079


🏁 Script executed:

#!/bin/bash
# Get the full sponsor-users-actions.js to see the complete function signature and defaults

echo "=== Reading sponsor-users-actions.js around getSponsorUserRequests ==="
cat -n src/actions/sponsor-users-actions.js | sed -n '71,100p'

echo ""
echo "=== Checking for DEFAULT_CURRENT_PAGE and DEFAULT_PER_PAGE constants ==="
head -n 70 src/actions/sponsor-users-actions.js | grep -n "DEFAULT_"

echo ""
echo "=== Checking the parent component context around RequestTable ==="
cat -n src/pages/sponsors/sponsor-users-list-page/index.js | sed -n '32,120p'

Repository: fntechgit/summit-admin

Length of output: 4231


Fix getRequests() call at line 32 to preserve search context after deletion.

After deleting a request, line 32 calls getRequests() with no arguments, which resets the search term, page, and sort order to defaults. This should pass the current term and pagination/sort state to maintain the user's search context:

getRequests(null, term, requests.currentPage, requests.perPage, requests.order, requests.orderDir);

The null values passed at lines 13, 18, and 23 correctly match the function signature where companyId defaults to null.

🤖 Prompt for AI Agents
In `@src/pages/sponsors/sponsor-users-list-page/components/request-table.js`
around lines 11 - 24, The deletion handler currently calls getRequests() with no
arguments which clears the current search/pagination/sort state; update the
deletion flow to call getRequests(null, term, requests.currentPage,
requests.perPage, requests.order, requests.orderDir) so it preserves the current
term and requests state (keep null for companyId as used in
handleRequestsPageChange/handlePerPageChange/handleRequestsSort) and ensure you
reference the existing requests and term variables when invoking getRequests.

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