Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ interface User {
email: string;
}

ApiKitClient.get<User[]>('/users')
ApiKitClient.get<User>('/users')
.then(response => console.log(response.data)) // Expected to be of type User[]
.catch(error => console.error(error));
```
Expand Down
6 changes: 3 additions & 3 deletions src/ApiKitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export class ApiKitClient {
}
}

public static async get<T>(endpoint: string, params?: URLSearchParams): Promise<AxiosResponse<T>> {
public static async get<T>(endpoint: string, params?: URLSearchParams): Promise<AxiosResponse<T[]>> {
this.checkInitialization();
return this.instance!.get<T>(endpoint, { params });
return this.instance!.get<T[]>(endpoint, { params });
}

public static async getOne<T>(endpoint: string, params?: URLSearchParams): Promise<AxiosResponse<T>> {
Expand Down Expand Up @@ -71,7 +71,7 @@ export class ApiKitClient {
return this.instance!.patch<T>(endpoint, data);
}

public static async delete<T>(endpoint: string): Promise<AxiosResponse<T>> {
public static async delete<T>(endpoint: string): Promise<AxiosResponse> {
this.checkInitialization();
return this.instance!.delete<T>(endpoint);
}
Expand Down