From 43ec802974e65c992a4c6f5dd4da2c1ac306fcc5 Mon Sep 17 00:00:00 2001 From: Dmitrii Maganov Date: Fri, 19 Jul 2019 03:26:27 +0300 Subject: [PATCH] fix: @feathersjs/adapter-commons: `update` id is non-nullable (#1468) --- packages/adapter-commons/src/service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/adapter-commons/src/service.ts b/packages/adapter-commons/src/service.ts index a3d33d7c95..19b452f7a1 100644 --- a/packages/adapter-commons/src/service.ts +++ b/packages/adapter-commons/src/service.ts @@ -29,7 +29,7 @@ export interface InternalServiceMethods { _find (params?: Params): Promise>; _get (id: Id, params?: Params): Promise; _create (data: Partial | Array>, params?: Params): Promise; - _update (id: NullableId, data: T, params?: Params): Promise; + _update (id: Id, data: T, params?: Params): Promise; _patch (id: NullableId, data: Partial, params?: Params): Promise; _remove (id: NullableId, params?: Params): Promise; } @@ -102,7 +102,7 @@ export class AdapterService implements ServiceMethods { return callMethod(this, '_create', data, params); } - update (id: NullableId, data: T, params?: Params): Promise { + update (id: Id, data: T, params?: Params): Promise { if (id === null || Array.isArray(data)) { return Promise.reject(new BadRequest( `You can not replace multiple instances. Did you mean 'patch'?`