From bbe7e2a131633e9a6e7aac7f7fa02a312bca63c7 Mon Sep 17 00:00:00 2001 From: Dmitrii Maganov Date: Fri, 5 Feb 2021 06:14:57 +0300 Subject: [PATCH] fix(adapter-commons): Return missing overloads (#2203) --- packages/adapter-commons/src/service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/adapter-commons/src/service.ts b/packages/adapter-commons/src/service.ts index e6763c1c19..3c43a8f958 100644 --- a/packages/adapter-commons/src/service.ts +++ b/packages/adapter-commons/src/service.ts @@ -171,6 +171,9 @@ export class AdapterService implements ServiceMethods> { return callMethod(this, '_get', id, params); } + create (data: Partial, params?: Params): Promise; + create (data: Partial[], params?: Params): Promise; + create (data: Partial | Partial[], params?: Params): Promise; create (data: Partial | Partial[], params?: Params): Promise { if (Array.isArray(data) && !this.allowsMulti('create')) { return Promise.reject(new MethodNotAllowed('Can not create multiple entries')); @@ -189,6 +192,9 @@ 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')); @@ -197,6 +203,9 @@ 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'));