Skip to content

Commit

Permalink
Fix missing return type
Browse files Browse the repository at this point in the history
  • Loading branch information
gray-adeyi committed Sep 6, 2024
1 parent 8725ff7 commit a5e6d07
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/clients/bulkCharge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class BulkChargeClient {
* @param batchCode : The batch code for the bulk charge you want to resume.
* @returns A promise containing a {@link PaystackResponse}
*/
resumeBatch(batchCode: string) {
resumeBatch(batchCode: string): Promise<PaystackResponse> {
return this.client.call(`/bulkcharge/resume/${batchCode}`, HTTPMethod.GET);
}
}
2 changes: 1 addition & 1 deletion src/clients/dedicatedAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default class DedicatedAccountClient {
* @param payload : {@link SplitPayload}
* @returns A promise containing a {@link PaystackResponse}
*/
split(payload: SplitPayload) {
split(payload: SplitPayload): Promise<PaystackResponse> {
return this.client.call(
"/dedicated_account/split",
HTTPMethod.POST,
Expand Down
4 changes: 2 additions & 2 deletions src/clients/paymentPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class PaymentPageClient {
* returned in the response
* @returns A promise containing a {@link PaystackResponse}
*/
getPages(options?: GetPagesOptions) {
getPages(options?: GetPagesOptions): Promise<PaystackResponse> {
return this.client.call("/page", HTTPMethod.GET, null, options);
}

Expand Down Expand Up @@ -96,7 +96,7 @@ export default class PaymentPageClient {
* @param products : An array of the IDs of the products to be added.
* @returns
*/
addProducts(id: string, products: string[]) {
addProducts(id: string, products: string[]): Promise<PaystackResponse> {
return this.client.call(`/page/${id}/product`, HTTPMethod.POST, products);
}
}
4 changes: 2 additions & 2 deletions src/clients/plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class PlanClient {
* @param idOrCode : The plan ID or code.
* @returns A promise containing a {@link PaystackResponse}
*/
getPlan(idOrCode: string) {
getPlan(idOrCode: string): Promise<PaystackResponse> {
return this.client.call(`/plan/${idOrCode}`, HTTPMethod.GET);
}

Expand All @@ -71,7 +71,7 @@ export default class PlanClient {
* the plan.
* @returns A promise containing a {@link PaystackResponse}
*/
update(idOrCode: string, payload: UpdatePlanPayload) {
update(idOrCode: string, payload: UpdatePlanPayload): Promise<PaystackResponse> {
return this.client.call(`/plan/${idOrCode}`, HTTPMethod.PUT, payload);
}
}
6 changes: 3 additions & 3 deletions src/clients/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class ProductClient {
* the response.
* @returns A promise containing a {@link PaystackResponse}
*/
getProducts(options?: GetProductsOptions) {
getProducts(options?: GetProductsOptions):Promise<PaystackResponse> {
return this.client.call("/product", HTTPMethod.GET, null, options);
}

Expand All @@ -58,7 +58,7 @@ export default class ProductClient {
*
* @returns A promise containing a {@link PaystackResponse}
*/
getProduct(id: string) {
getProduct(id: string): Promise<PaystackResponse> {
return this.client.call(`/product/${id}`, HTTPMethod.GET);
}

Expand All @@ -68,7 +68,7 @@ export default class ProductClient {
* the product.
* @returns A promise containing a {@link PaystackResponse}
*/
update(id: string, payload: UpdateProductPayload) {
update(id: string, payload: UpdateProductPayload):Promise<PaystackResponse> {
return this.client.call(`/product/${id}`, HTTPMethod.PUT, payload);
}
}
9 changes: 5 additions & 4 deletions src/clients/subAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
GetSubAccountsOptions,
UpdateSubAccountPayload,
} from "../types/clients/subAccount.ts";
import { PaystackResponse } from "../types/global.ts";

/**
* SubAccountClient provides methods that lets you interface with Paystack's
Expand Down Expand Up @@ -36,7 +37,7 @@ export default class SubAccountClient {
* create a sub account.
* @returns A promise containing a {@link PaystackResponse}
*/
create(payload: CreateSubAccountPayload) {
create(payload: CreateSubAccountPayload): Promise<PaystackResponse> {
return this.client.call("/subaccount", HTTPMethod.POST, payload);
}

Expand All @@ -47,7 +48,7 @@ export default class SubAccountClient {
* data that is returned in the response.
* @returns A promise containing a {@link PaystackResponse}
*/
getSubAccounts(options?: GetSubAccountsOptions) {
getSubAccounts(options?: GetSubAccountsOptions):Promise<PaystackResponse> {
return this.client.call("/subaccount", HTTPMethod.GET, null, options);
}

Expand All @@ -57,7 +58,7 @@ export default class SubAccountClient {
* @param idOrCode : The subaccount ``ID`` or ``code`` you want to fetch
* @returns A promise containing a {@link PaystackResponse}
*/
getSubAccount(idOrCode: string) {
getSubAccount(idOrCode: string): Promise<PaystackResponse> {
return this.client.call(`/subaccount/${idOrCode}`, HTTPMethod.GET);
}

Expand All @@ -69,7 +70,7 @@ export default class SubAccountClient {
* the subaccount
* @returns A promise containing a {@link PaystackResponse}
*/
update(idOrCode: string, payload: UpdateSubAccountPayload) {
update(idOrCode: string, payload: UpdateSubAccountPayload): Promise<PaystackResponse> {
return this.client.call(`/subaccount/${idOrCode}`, HTTPMethod.PUT, payload);
}
}
2 changes: 1 addition & 1 deletion src/restClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class RestClient {
data?: any,
// deno-lint-ignore no-explicit-any
params?: Record<string, any>,
) {
): Promise<PaystackResponse> {
const handler = this.getMethodHandler(method);
let response: AxiosResponse;
if ([HTTPMethod.GET, HTTPMethod.DELETE].includes(method)) {
Expand Down

0 comments on commit a5e6d07

Please sign in to comment.