-
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 #37
base: main
Are you sure you want to change the base?
Conversation
…hing else in the application relies on "objectId"
const TO_DATE = DateTime.now().plus({ month: 1 }).toISODate(); | ||
|
||
const handleOrganizationSelection = (id: Id) => { | ||
fetchOrganization(id) |
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 This is what I'm referring to, can we/should we rework fetchOrganization to use your use-api-data in this PR, or do that across the board in a second fast-follower PR? I'm open to either option.
}; | ||
|
||
const handleRelationshipSelection = (id: Id) => { | ||
fetchCoachingRelationshipWithUserNames(organization.id, id) |
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 Same thing here...
}; | ||
|
||
const handleSessionSelection = (id: Id) => { | ||
fetchCoachingSessions(relationship.id) |
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 and here again...
@@ -20,7 +20,7 @@ interface AppState { | |||
coachingRelationship: CoachingRelationshipWithUserNames; | |||
} | |||
|
|||
interface AppStateActions { | |||
export interface AppStateActions { |
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.
export interface AppStateActions { | |
interface AppStateActions { |
@qafui this is meant to be private to AppStateStore, any reason to broaden its scope?
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.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.