SkinFirts communicates with a MockAPI-hosted backend through a small, focused API layer split across three files:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/BhushanBadhe39/SkinFirts/llms.txt
Use this file to discover all available pages before exploring further.
src/api/Client.js (the shared Axios instance), src/api/doctorsApi.js (doctor-related requests), and src/api/usersApi.js (user-related requests). All functions are async and return the unwrapped data field from the Axios response, so callers receive plain JavaScript objects and arrays rather than raw Axios response wrappers.
apiClient
The shared Axios instance is created once insrc/api/Client.js and imported by every API module. It sets two global defaults that apply to every request made through it.
src/api/Client.js
| Property | Value | Description |
|---|---|---|
baseURL | https://6a63416d1bffb2ffab8bf093.mockapi.io | Root URL prepended to every relative path |
timeout | 10000 (10 s) | Request is aborted and an error is thrown if the server does not respond within this period |
Doctors API — src/api/doctorsApi.js
src/api/doctorsApi.js
fetchDoctors()
Fetches the full list of doctors from the doctorData resource. This function takes no arguments and is the primary data-loading step triggered by the loadDoctors Redux thunk.
HTTP request: GET {baseURL}/doctorData
Parameters: None
Resolves to an array of all doctor objects stored in the MockAPI
doctorData collection.updateDoctors(email, updates)
Sends a partial update (PATCH) to a single doctor record identified by email. In the MockAPI schema, the doctor’s id field is used as the path parameter (the argument is named email in the source but carries the record’s id value when called from toggleFavorite).
HTTP request: PATCH {baseURL}/doctorData/:email
The unique identifier of the doctor record used as the URL path parameter. Despite the name, the Redux thunk passes
doctor.id here.A partial doctor object whose fields are merged into the existing record on the server. For example,
{ isFavorite: true } toggles the favourite flag.Resolves to the full updated doctor object as returned by MockAPI after the merge.
Users API — src/api/usersApi.js
src/api/usersApi.js
createUser(newUser)
Creates a new user record in the MockAPI users collection. Before posting, the function merges a set of pre-defined appointment seed fields (User_PreDefined_Fields) with the caller-supplied newUser object. Values in newUser take precedence over the pre-defined defaults because newUser appears on the right-hand side of the spread.
HTTP request: POST {baseURL}/users/
User registration fields supplied by the sign-up form (e.g.
name, email, password). These are spread on top of the pre-defined appointment seed fields before the payload is posted.| Field | Type | Seeded Values |
|---|---|---|
completeAppointments | string[] | ["1","2","3","4","5","6","7"] |
upcomingAppointments | string[] | ["15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40"] |
cancelledAppointments | string[] | ["8","9","10","11","12","13","14"] |
Resolves to the newly created user object including the server-assigned
id and all merged fields.fetchUsers()
Fetches every user record from the users resource. This is used by loginUser in authService.js to perform client-side credential matching.
HTTP request: GET {baseURL}/users
Parameters: None
Resolves to an array of all user objects in the MockAPI
users collection.updateUser(id, updates)
Sends a partial update (PATCH) to a single user record identified by its numeric string id.
HTTP request: PATCH {baseURL}/users/:id
The user’s unique numeric string ID as assigned by MockAPI (e.g.
"42"). Used as the URL path parameter.A partial user object whose fields are merged into the existing record. For example,
{ name: "Jane" } updates only the name field.Resolves to the complete updated user object as returned by MockAPI after the merge.