Fix: header stat counts not updating after bulk-assign or revoke on Contract Admin page#3581
Fix: header stat counts not updating after bulk-assign or revoke on Contract Admin page#3581daniellefrappier18 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
There was a problem hiding this comment.
Pull request overview
This PR fixes stale header stat counts on the Contract Admin page by ensuring the contract detail React Query cache is invalidated after mutations that change server-side seat counts (bulk-assign and revoke). This aligns the UI header (Unassigned / Pending claim) with the latest backend state without requiring a full page refresh.
Changes:
- Invalidate the
managerOrganizationKeys.contractDetail(...)query after bulk seat assignment and code revocation mutations. - Add ContractAdminPage tests that simulate post-mutation contract-detail changes and assert header counts update accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontends/main/src/app-pages/ContractAdminPage/ContractAdminPage.test.tsx | Adds regression tests verifying header stat counts refresh after bulk-assign and revoke actions. |
| frontends/api/src/mitxonline/hooks/organizations/index.ts | Invalidates the contract detail query on seat-assign and revoke mutations so the header stats refetch and update. |
What are the relevant tickets?
Description (What does it do?)
The Contract Admin page header shows stat counts (Unassigned, Pending claim, etc.) derived from the contract detail query. Bulk-assigning seats or revoking a code mutates those counts server-side, but the
contractDetailquery wasn't being invalidated on mutation, so the header stayed stale until a full page refresh.Screenshots (if appropriate):
counts.mov
How can this be tested?
Additional Context