-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
api clientAny thing to do with the API ClientAny thing to do with the API ClientenhancementNew feature or requestNew feature or request
Milestone
Description
This can only be done when #65 and #98 are complete.
To do
- create a folder in
src/api
calledrequestHandler
- Create
src/api/requests/quiz.ts
This request handler must have two public methods
getAll
getQuiz
getAll
- Makes API call to
/api/v1/quizzes
- Returns JSON
getQuiz
- Makes API call to
/api/v1/quiz/:id
- Takes an integer as an
:id
- Returns JSON
Acceptance criteria
- API
getAll
can be for-filled - API
getQuiz
can be for-filled - Unit tests have been added
TS ref for mocking axios request https://www.csrhymes.com/2022/03/09/mocking-axios-with-jest-and-typescript.html
Testing notes
Two types of tests are needed.
- Unit tests
- Mocking out Axios
get
calls
- Integration tests (Not to be added in this ticket)
- Testing the JSONServer setup
Metadata
Metadata
Assignees
Labels
api clientAny thing to do with the API ClientAny thing to do with the API ClientenhancementNew feature or requestNew feature or request