diff --git a/packages/knex/src/index.ts b/packages/knex/src/index.ts index 59a59e1841..7f2c347302 100644 --- a/packages/knex/src/index.ts +++ b/packages/knex/src/index.ts @@ -37,6 +37,7 @@ export class KnexService< async create(data: Data, params?: ServiceParams): Promise async create(data: Data[], params?: ServiceParams): Promise + async create(data: Data | Data[], params?: ServiceParams): Promise async create(data: Data | Data[], params?: ServiceParams): Promise { if (Array.isArray(data) && !this.allowsMulti('create', params)) { throw new MethodNotAllowed('Can not create multiple entries') @@ -54,6 +55,7 @@ export class KnexService< async patch(id: Id, data: PatchData, params?: ServiceParams): Promise async patch(id: null, data: PatchData, params?: ServiceParams): Promise + async patch(id: NullableId, data: PatchData, params?: ServiceParams): Promise async patch(id: NullableId, data: PatchData, params?: ServiceParams): Promise { const { $limit, ...query } = await this.sanitizeQuery(params) @@ -65,6 +67,7 @@ export class KnexService< async remove(id: Id, params?: ServiceParams): Promise async remove(id: null, params?: ServiceParams): Promise + async remove(id: NullableId, params?: ServiceParams): Promise async remove(id: NullableId, params?: ServiceParams): Promise { const { $limit, ...query } = await this.sanitizeQuery(params) diff --git a/packages/mongodb/src/index.ts b/packages/mongodb/src/index.ts index 1b86dffff1..e6b73579b5 100644 --- a/packages/mongodb/src/index.ts +++ b/packages/mongodb/src/index.ts @@ -32,6 +32,7 @@ export class MongoDBService< async create(data: Data, params?: ServiceParams): Promise async create(data: Data[], params?: ServiceParams): Promise + async create(data: Data | Data[], params?: ServiceParams): Promise async create(data: Data | Data[], params?: ServiceParams): Promise { if (Array.isArray(data) && !this.allowsMulti('create', params)) { throw new MethodNotAllowed('Can not create multiple entries') @@ -49,6 +50,7 @@ export class MongoDBService< async patch(id: null, data: PatchData, params?: ServiceParams): Promise async patch(id: AdapterId, data: PatchData, params?: ServiceParams): Promise + async patch(id: NullableAdapterId, data: PatchData, params?: ServiceParams): Promise async patch(id: NullableAdapterId, data: PatchData, params?: ServiceParams): Promise { const { $limit, ...query } = await this.sanitizeQuery(params) @@ -60,6 +62,7 @@ export class MongoDBService< async remove(id: AdapterId, params?: ServiceParams): Promise async remove(id: null, params?: ServiceParams): Promise + async remove(id: NullableAdapterId, params?: ServiceParams): Promise async remove(id: NullableAdapterId, params?: ServiceParams): Promise { const { $limit, ...query } = await this.sanitizeQuery(params)