Module: Axios HTTP Request Utility
This module provides functions for sending HTTP requests to the backend API
using Axios, a promise-based HTTP client for the browser and Node.js.
- Source:
Members
(inner, constant) BASE_URL :string
Base URL for the backend API.
Type:
- string
- Source:
Methods
(async, inner) sendRequest(method, path, dataopt) → {Promise.<Object>}
Sends a request to the backend API.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
method |
string | The HTTP method for the request (e.g., GET, POST, PUT, DELETE). | |
path |
string | The endpoint path for the request. | |
data |
Object |
<optional> |
The data to be sent with the request (optional). |
- Source:
Returns:
A promise that resolves to an object containing the request status and data.
- Type
- Promise.<Object>
(async, inner) signOut() → {Promise.<Object>}
Signs the user out by sending a request to the signout endpoint.
- Source:
Returns:
A promise that resolves to an object indicating the success or failure of the sign-out operation.
- Type
- Promise.<Object>
(async, inner) todoApi(method, path, dataopt) → {Promise.<Object>}
Sends authenticated requests to the backend API using the user's token.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
method |
string | The HTTP method for the request. | |
path |
string | The endpoint path for the request. | |
data |
Object |
<optional> |
The data to be sent with the request (optional). |
- Source:
Returns:
A promise that resolves to an object containing the request status and data.
- Type
- Promise.<Object>