-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upcoming: [M3-7414] - Add mocks and update queries for new Parent/Child endpoints #9977
upcoming: [M3-7414] - Add mocks and update queries for new Parent/Child endpoints #9977
Conversation
Boolean(grants?.global?.child_account_access) || hasExplicitAuthToken, | ||
(Boolean(user?.user_type === 'parent') && !profile?.restricted) || | ||
Boolean(grants?.global?.child_account_access) || | ||
hasExplicitAuthToken, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change and the change in the query below allows an unrestricted parent user (who cannot call useGrants
) to access the endpoint.
9e2ab75
to
e270bf4
Compare
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good
Verified the following returns the mocked data
|
Description 📝
This PR adds Mock Service Worker (MSW) endpoints for all new "Parent/Child" API calls. (Updates to all existing endpoints were previously done in #9942.) These changes will enable us to mock the Parent/Child API interactions, ensuring our development remains unimpeded and independent of ongoing API changes.
Changes 🔄
useChildAccounts
anduseChildAccount
to allow an unrestricted parent account to be able to reach these endpoints. (They will havechild_account_access
by default, but we can't check grants on an unrestricted user, which was relied upon in the initial implementation of the queries.)Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
REACT_APP_PROXY_PAT
to your.env
with any token to test. We'll need to store a mock "proxy" token to log into a child account somewhere until the API returns it.yarn dev
.Verification steps
(How to verify changes)
You will need:
GET /account/child-accounts
,GET /account/child-accounts/<euuid>
, andPOST /account/child-accounts/<euuid>/token
are all executing and returning the expected data.As an Author I have considered 🤔
Check all that apply