Skip to content

Commit

Permalink
Add TODOs for updating state with generic types on change events
Browse files Browse the repository at this point in the history
  • Loading branch information
qafui committed Oct 7, 2024
1 parent 1349240 commit 8810b58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/components/ui/dashboard/dynamic-api-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function DynamicApiSelect<T>({
isLoading,
error,
} = useApiData<ApiResponse<T>>(url, { method, params });

const [value, setValue] = useState<string>("");

const handleValueChange = (newValue: string) => {
Expand Down
7 changes: 4 additions & 3 deletions src/components/ui/dashboard/join-coaching-session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ export function JoinCoachingSession({
setCoachingSessionId: state.setCoachingSessionId
}));

// TODO: pass Organization type
const handleOrganizationSelection = (value: string) => {
setOrganizationId(value);
setRelationshipId;
setCoachingSessionId;
}

// TODO: pass Relationship type
const handleRelationshipSelection = (value: string) => {
setRelationshipId(value);
setCoachingSessionId;
}

// TODO: pass CoachingSession type
const handleSessionSelection = (value: string) => {
setCoachingSessionId(value);
}
Expand All @@ -76,7 +77,7 @@ export function JoinCoachingSession({
onChange={handleOrganizationSelection}
placeholder="Select an organization"
getOptionLabel={(org) => org.name}
getOptionValue={(org) => org.id} // FIXME: this doesn't seem to display the currently selected organization when the page loads and the org.id is set
getOptionValue={(org) => org.id}
elementId="organization-selector"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stores/app-state-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface AppState {
coachingRelationship: CoachingRelationshipWithUserNames;
}

interface AppStateActions {
export interface AppStateActions {
setOrganizationId: (organizationId: Id) => void;
setRelationshipId: (relationshipId: Id) => void;
setCoachingSessionId: (coachingSessionId: Id) => void;
Expand Down

0 comments on commit 8810b58

Please sign in to comment.