From f4095e19dbd86be10c5a0ccf5b8744f49f829c60 Mon Sep 17 00:00:00 2001 From: Ayo Solomon <48213053+Ayoseun@users.noreply.github.com> Date: Mon, 4 Mar 2024 16:32:40 +0100 Subject: [PATCH 1/3] Updated the ApiSdk constructor documentation Updated the ApiSdk constructor documentation comment to provide clearer guidance on the config parameter, specifying it as an Axios request config. Included an example demonstrating how the config object can be structured for various request options such as HTTP method, URL, query parameters, request body data, and headers. This enhancement improves the readability and usability of the codebase, making it easier for developers to understand and utilize the ApiSdk class. --- libs/api-sdk/src/apiSdk.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/api-sdk/src/apiSdk.ts b/libs/api-sdk/src/apiSdk.ts index 684d24e4..c5a3a097 100644 --- a/libs/api-sdk/src/apiSdk.ts +++ b/libs/api-sdk/src/apiSdk.ts @@ -20,7 +20,22 @@ export default class ApiSdk { /** * Initializes the ApiSdk object with a Supported URL or custom URL. * @param url Supported URL or custom URL. - * @param config Request config. + * @param config [Axios](https://axios-http.com/docs/req_config) request config type. + * @example config const axiosConfig = { + * method: 'get', // HTTP method (e.g., 'get', 'post', 'put', 'delete') + * url: 'url.com', // URL of the request + * params: { // Optional query parameters (key-value pairs) + * id: 123, + * page: 2 + * }, + * data: { // Optional data to be sent in the request body (depends on method) + * name: 'John Doe', + * age: 30 + * }, + * headers: { // Optional request headers (key-value pairs) + * 'Content-Type': 'application/json' + * } + * }; */ constructor(url: SupportedUrl | string = SupportedUrl.PROD, config?: any) { checkParameter(url, "url", "string") From 76076147f9b336a6f8d3e9e83c1f7d513a5c3685 Mon Sep 17 00:00:00 2001 From: Ayo Solomon <48213053+Ayoseun@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:45:16 +0100 Subject: [PATCH 2/3] Removed axios config comment example --- libs/api-sdk/src/apiSdk.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/libs/api-sdk/src/apiSdk.ts b/libs/api-sdk/src/apiSdk.ts index c5a3a097..fcc869ae 100644 --- a/libs/api-sdk/src/apiSdk.ts +++ b/libs/api-sdk/src/apiSdk.ts @@ -21,21 +21,6 @@ export default class ApiSdk { * Initializes the ApiSdk object with a Supported URL or custom URL. * @param url Supported URL or custom URL. * @param config [Axios](https://axios-http.com/docs/req_config) request config type. - * @example config const axiosConfig = { - * method: 'get', // HTTP method (e.g., 'get', 'post', 'put', 'delete') - * url: 'url.com', // URL of the request - * params: { // Optional query parameters (key-value pairs) - * id: 123, - * page: 2 - * }, - * data: { // Optional data to be sent in the request body (depends on method) - * name: 'John Doe', - * age: 30 - * }, - * headers: { // Optional request headers (key-value pairs) - * 'Content-Type': 'application/json' - * } - * }; */ constructor(url: SupportedUrl | string = SupportedUrl.PROD, config?: any) { checkParameter(url, "url", "string") From 228abfa19f1225b581b9db2ec25b0389bb0d85ab Mon Sep 17 00:00:00 2001 From: Ayo Solomon <48213053+Ayoseun@users.noreply.github.com> Date: Tue, 5 Mar 2024 13:14:17 +0100 Subject: [PATCH 3/3] Corrected text casing --- libs/api-sdk/src/apiSdk.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/api-sdk/src/apiSdk.ts b/libs/api-sdk/src/apiSdk.ts index fcc869ae..b9d925e1 100644 --- a/libs/api-sdk/src/apiSdk.ts +++ b/libs/api-sdk/src/apiSdk.ts @@ -20,7 +20,7 @@ export default class ApiSdk { /** * Initializes the ApiSdk object with a Supported URL or custom URL. * @param url Supported URL or custom URL. - * @param config [Axios](https://axios-http.com/docs/req_config) request config type. + * @param config [Axios](https://axios-http.com/docs/req_config) Request Config. */ constructor(url: SupportedUrl | string = SupportedUrl.PROD, config?: any) { checkParameter(url, "url", "string")