-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add allergy management features including data fetching and UI compon…
…ents
- Loading branch information
1 parent
e4832b5
commit e2a96bc
Showing
10 changed files
with
371 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { AllergyListPayload } from 'api/types/AllergyData' | ||
|
||
import { Params } from '..' | ||
import { DemoStore } from './store' | ||
|
||
type AllergyPageNumber = '1' | ||
|
||
/** | ||
* Type denoting the demo data store | ||
*/ | ||
export type AllergyList = { | ||
'/v1/health/allergy-intolerances': { | ||
'1': AllergyListPayload | ||
} | ||
} | ||
|
||
export type AllergyDemoStore = AllergyList | ||
|
||
/** | ||
* Type to define the mock returns to keep type safety | ||
*/ | ||
export type AllergyDemoReturnTypes = undefined | AllergyListPayload | ||
|
||
export const getAllergyList = (store: DemoStore, params: Params, endpoint: string): AllergyListPayload => { | ||
const page = params['page[number]'] | ||
return store[endpoint as keyof AllergyList][page as AllergyPageNumber] as AllergyListPayload | ||
} |
Oops, something went wrong.