From 609f583c4e52e040fe6cd19238f9e4683dfdac92 Mon Sep 17 00:00:00 2001 From: "Ryan Munro (Monbrey)" Date: Fri, 2 Aug 2019 13:21:44 +1000 Subject: [PATCH] Test SDK without the "single" parameter --- src/client.ts | 2 +- src/queryBuilder.ts | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/client.ts b/src/client.ts index 779f22f..840a879 100644 --- a/src/client.ts +++ b/src/client.ts @@ -28,7 +28,7 @@ export class Client { if (params) { params.map(param => { - if (resource === 'sets' && param.name === 'id') { + if (param.name === 'id') { url = `/${param.value}`; } }); diff --git a/src/queryBuilder.ts b/src/queryBuilder.ts index b929c75..80a90cc 100644 --- a/src/queryBuilder.ts +++ b/src/queryBuilder.ts @@ -22,7 +22,7 @@ export class QueryBuilder { value: id }]; - return this.returnResponse(t.resource(), params, true); + return this.returnResponse(t.resource(), params); } static where(type: (new() => T), params: IQuery[]): Promise { @@ -31,13 +31,9 @@ export class QueryBuilder { return this.returnResponse(t.resource(), params); } - private static returnResponse(resource: string, params: IQuery[], single?: boolean): Promise { + private static returnResponse(resource: string, params: IQuery[]): Promise { return Client.get(resource, params) .then(response => { - if (single) { - return response[0]; - } - return response; }) .catch(error => console.error(error));