From 93d36affb8772c2cc454e57fafe2ca9e878d9084 Mon Sep 17 00:00:00 2001 From: UnderKoen Date: Mon, 19 Feb 2024 09:39:05 +0100 Subject: [PATCH] chore: implement pr feedback --- src/PrintOne.ts | 12 ++++++------ src/models/Batch.ts | 7 +------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/PrintOne.ts b/src/PrintOne.ts index 3c4f0f7..90ab7cf 100644 --- a/src/PrintOne.ts +++ b/src/PrintOne.ts @@ -311,11 +311,11 @@ export class PrintOne { /** * Get an order by its id. * @param { string } id The id of the order. - * @param url The url to use for this request + * @param basePath The basePath to use for this request * @throws { PrintOneError } If the order could not be found. */ - public async getOrder(id: string, url = "orders"): Promise { - const data = await this.client.GET(`${url}/${id}`); + public async getOrder(id: string, basePath = "orders"): Promise { + const data = await this.client.GET(`${basePath}/${id}`); return new Order(this.protected, data); } @@ -327,12 +327,12 @@ export class PrintOne { * @param options.page The page to return. * @param options.sortBy The fields to sort by, can be "createdAt", "anonymizedAt", "updatedAt", "friendlyStatus", "sendDate". * @param options.filter The filters to apply. - * @param url The url to use for this request + * @param basePath The basePath to use for this request * @throws { PrintOneError } If the order could not be found. */ public async getOrders( options: OrderPaginatedQuery = {}, - url = "orders", + basePath = "orders", ): Promise> { let params = { ...sortToQuery(options), @@ -369,7 +369,7 @@ export class PrintOne { }; } - const data = await this.client.GET>(url, { + const data = await this.client.GET>(basePath, { params, }); diff --git a/src/models/Batch.ts b/src/models/Batch.ts index 06287f2..1687a2b 100644 --- a/src/models/Batch.ts +++ b/src/models/Batch.ts @@ -77,12 +77,7 @@ export class Batch { failed: number; cancelled: number; } { - return { - processing: this._data.orders.processing, - success: this._data.orders.success, - failed: this._data.orders.failed, - cancelled: this._data.orders.cancelled, - }; + return this._data.orders; } public get createdAt(): Date {