From d7740f96506bdd5f323ed5e9c1b5ff4d41962a7c Mon Sep 17 00:00:00 2001 From: David Luecke Date: Mon, 14 Oct 2019 14:30:58 -0700 Subject: [PATCH 1/2] fix: Remove adapter commons type alternatives --- packages/adapter-commons/src/service.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/adapter-commons/src/service.ts b/packages/adapter-commons/src/service.ts index 6182dbb4e8..cc571673df 100644 --- a/packages/adapter-commons/src/service.ts +++ b/packages/adapter-commons/src/service.ts @@ -94,9 +94,6 @@ export class AdapterService implements ServiceMethods { return callMethod(this, '_get', id, params); } - create (data: Partial, params?: Params): Promise; - create (data: Array>, params?: Params): Promise; - create (data: Partial | Array>, params?: Params): Promise; create (data: Partial | Array>, params?: Params): Promise { if (Array.isArray(data) && !this.allowsMulti('create')) { return Promise.reject(new MethodNotAllowed(`Can not create multiple entries`)); @@ -115,9 +112,6 @@ export class AdapterService implements ServiceMethods { return callMethod(this, '_update', id, data, params); } - patch (id: Id, data: Partial, params?: Params): Promise; - patch (id: null, data: Partial, params?: Params): Promise; - patch (id: NullableId, data: Partial, params?: Params): Promise; patch (id: NullableId, data: Partial, params?: Params): Promise { if (id === null && !this.allowsMulti('patch')) { return Promise.reject(new MethodNotAllowed(`Can not patch multiple entries`)); @@ -126,9 +120,6 @@ export class AdapterService implements ServiceMethods { return callMethod(this, '_patch', id, data, params); } - remove (id: Id, params?: Params): Promise; - remove (id: null, params?: Params): Promise; - remove (id: NullableId, params?: Params): Promise; remove (id: NullableId, params?: Params): Promise { if (id === null && !this.allowsMulti('remove')) { return Promise.reject(new MethodNotAllowed(`Can not remove multiple entries`)); From 0f210db7576fe3cf3fa07d363db11b7d5a46b0b3 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Mon, 14 Oct 2019 14:46:14 -0700 Subject: [PATCH 2/2] Add normal type back to find --- packages/adapter-commons/src/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/adapter-commons/src/service.ts b/packages/adapter-commons/src/service.ts index cc571673df..6a462f7819 100644 --- a/packages/adapter-commons/src/service.ts +++ b/packages/adapter-commons/src/service.ts @@ -26,7 +26,7 @@ export interface ServiceOptions { } export interface InternalServiceMethods { - _find (params?: Params): Promise>; + _find (params?: Params): Promise>; _get (id: Id, params?: Params): Promise; _create (data: Partial | Array>, params?: Params): Promise; _update (id: Id, data: T, params?: Params): Promise;