Difficulty: Hard
Type: Refactor
Summary
Change the access check flow from query-driven execution to mutation-driven execution. Manual user-triggered checks should behave like actions, not passive cached queries.
Current Behaviour
app/access-check.tsx stores checkParams in local state and calls checkAccess with either the real params or an empty fallback object. The underlying hook uses useQuery and relies on enabled to avoid running with empty values.
Expected Behaviour
Access checks should run only when the user submits the form, expose clear pending and result states, and avoid stale query results when inputs change.
Suggested Implementation
Replace the access check query wrapper with a useMutation-based hook. Reset the previous result when input changes after a completed check. Keep form validation separate from the network action.
Files or Areas Likely Affected
src/features/access/useAccessCheck.ts
app/access-check.tsx
src/components/AccessStatusCard.tsx
tests/
Acceptance Criteria
Additional Notes
This issue should complement, not duplicate, the existing form validation issue.
Difficulty: Hard
Type: Refactor
Summary
Change the access check flow from query-driven execution to mutation-driven execution. Manual user-triggered checks should behave like actions, not passive cached queries.
Current Behaviour
app/access-check.tsxstorescheckParamsin local state and callscheckAccesswith either the real params or an empty fallback object. The underlying hook usesuseQueryand relies onenabledto avoid running with empty values.Expected Behaviour
Access checks should run only when the user submits the form, expose clear pending and result states, and avoid stale query results when inputs change.
Suggested Implementation
Replace the access check query wrapper with a
useMutation-based hook. Reset the previous result when input changes after a completed check. Keep form validation separate from the network action.Files or Areas Likely Affected
src/features/access/useAccessCheck.tsapp/access-check.tsxsrc/components/AccessStatusCard.tsxtests/Acceptance Criteria
Additional Notes
This issue should complement, not duplicate, the existing form validation issue.