Skip to content

Commit

Permalink
chore: implement pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderKoen committed Feb 19, 2024
1 parent 3b4cf53 commit 93d36af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/PrintOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Order> {
const data = await this.client.GET<IOrder>(`${url}/${id}`);
public async getOrder(id: string, basePath = "orders"): Promise<Order> {
const data = await this.client.GET<IOrder>(`${basePath}/${id}`);

return new Order(this.protected, data);
}
Expand All @@ -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<PaginatedResponse<Order>> {
let params = {
...sortToQuery(options),
Expand Down Expand Up @@ -369,7 +369,7 @@ export class PrintOne {
};
}

const data = await this.client.GET<IPaginatedResponse<IOrder>>(url, {
const data = await this.client.GET<IPaginatedResponse<IOrder>>(basePath, {
params,
});

Expand Down
7 changes: 1 addition & 6 deletions src/models/Batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 93d36af

Please sign in to comment.