-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor Select Coaching Session Component #34
Conversation
url: string, | ||
method?: 'GET' | 'POST', | ||
params?: Record<string, string>, | ||
// body?: Record<string, any> |
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.
@qafui is this intentional to be commented out?
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.
Yes. I realized that this hook is a little too generic. I suggest we split it into a few custom hooks (one for credentialed POST
fetches and another for simple GET
requests where we can use more Cache
and revalidation config options to change the behavior of the useSWR
hook. We would need that for taking notes and more live streaming behaviors.
Description
This PR adds the
useSWR
hook from theswr
library as a wrapper around a global fetcher hook (useApiData). It allows any component to access the data it needs for rendering dynamic values from the API.A dashboard component is refactored to use the new hook to fetch data for conditionally rendered select components and a button. The
JoinCoachingSession
component allows a user to select an organization, a coaching relationship and a session and join the session with a button click.Todo
SelectGroup
Changes
JoinCoachingSession
component responsible for setting organization, relationship and session IDs in the state tree.Screenshots / Videos Showing UI Changes (if applicable)
Testing Strategy
Login and attempt to join a session using the component illustrated in the image
Concerns
dynamic-api-select
component should be separated into its own component.