From 2f29042433c8c5fe94cef4abe310feb2d8d4db3d Mon Sep 17 00:00:00 2001 From: Mostafa Date: Wed, 20 Mar 2024 02:33:50 +0200 Subject: [PATCH 1/4] SCKT-5 | Get Method - Fix types of getAll method --- src/ApiKitClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ApiKitClient.ts b/src/ApiKitClient.ts index 2302a80..f5c8ae3 100644 --- a/src/ApiKitClient.ts +++ b/src/ApiKitClient.ts @@ -41,9 +41,9 @@ export class ApiKitClient { } } - public static async get(endpoint: string, params?: URLSearchParams): Promise> { + public static async getAll(endpoint: string, params?: URLSearchParams): Promise> { this.checkInitialization(); - return this.instance!.get(endpoint, { params }); + return this.instance!.get(endpoint, { params }); } public static async getOne(endpoint: string, params?: URLSearchParams): Promise> { From a787c3fce10d3e9397b94d8be683b06c28786524 Mon Sep 17 00:00:00 2001 From: Mostafa Date: Wed, 20 Mar 2024 02:38:43 +0200 Subject: [PATCH 2/4] SCKT-5 | README.md - Update readme file for `getAll` method --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d25e07..96f136b 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ interface User { email: string; } -ApiKitClient.get('/users') +ApiKitClient.getAll('/users') .then(response => console.log(response.data)) // Expected to be of type User[] .catch(error => console.error(error)); ``` From eb4bd888a331a134fa6dcb5686095f743f996a2e Mon Sep 17 00:00:00 2001 From: Mostafa Date: Wed, 20 Mar 2024 10:43:42 +0200 Subject: [PATCH 3/4] SCKT-5 | GET Method - Revert get Method name --- README.md | 2 +- src/ApiKitClient.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 96f136b..16b5fdc 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ interface User { email: string; } -ApiKitClient.getAll('/users') +ApiKitClient.get('/users') .then(response => console.log(response.data)) // Expected to be of type User[] .catch(error => console.error(error)); ``` diff --git a/src/ApiKitClient.ts b/src/ApiKitClient.ts index f5c8ae3..c8789ac 100644 --- a/src/ApiKitClient.ts +++ b/src/ApiKitClient.ts @@ -41,7 +41,7 @@ export class ApiKitClient { } } - public static async getAll(endpoint: string, params?: URLSearchParams): Promise> { + public static async get(endpoint: string, params?: URLSearchParams): Promise> { this.checkInitialization(); return this.instance!.get(endpoint, { params }); } From 800dc87a5cd635d116d39b88709150fe3c77eac0 Mon Sep 17 00:00:00 2001 From: Mostafa Date: Wed, 20 Mar 2024 22:19:44 +0200 Subject: [PATCH 4/4] SCKT-5 | DELETE Method - Remove modal type from returned value of delete method --- src/ApiKitClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApiKitClient.ts b/src/ApiKitClient.ts index c8789ac..5030bc4 100644 --- a/src/ApiKitClient.ts +++ b/src/ApiKitClient.ts @@ -71,7 +71,7 @@ export class ApiKitClient { return this.instance!.patch(endpoint, data); } - public static async delete(endpoint: string): Promise> { + public static async delete(endpoint: string): Promise { this.checkInitialization(); return this.instance!.delete(endpoint); }