Skip to content

Commit

Permalink
fix: @feathersjs/adapter-commons: update id is non-nullable (#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonagam authored and daffl committed Jul 19, 2019
1 parent 169b230 commit 43ec802
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/adapter-commons/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface InternalServiceMethods<T = any> {
_find (params?: Params): Promise<T | T[] | Paginated<T>>;
_get (id: Id, params?: Params): Promise<T>;
_create (data: Partial<T> | Array<Partial<T>>, params?: Params): Promise<T | T[]>;
_update (id: NullableId, data: T, params?: Params): Promise<T>;
_update (id: Id, data: T, params?: Params): Promise<T>;
_patch (id: NullableId, data: Partial<T>, params?: Params): Promise<T>;
_remove (id: NullableId, params?: Params): Promise<T>;
}
Expand Down Expand Up @@ -102,7 +102,7 @@ export class AdapterService<T = any> implements ServiceMethods<T> {
return callMethod(this, '_create', data, params);
}

update (id: NullableId, data: T, params?: Params): Promise<T> {
update (id: Id, data: T, params?: Params): Promise<T> {
if (id === null || Array.isArray(data)) {
return Promise.reject(new BadRequest(
`You can not replace multiple instances. Did you mean 'patch'?`
Expand Down

0 comments on commit 43ec802

Please sign in to comment.