From 34c88f0b6d127357f4bf49df85ef49852a875ada Mon Sep 17 00:00:00 2001 From: fratzinger <22286818+fratzinger@users.noreply.github.com> Date: Thu, 22 Jun 2023 12:59:34 +0200 Subject: [PATCH 1/2] fix(feathers): Paginated for ServiceMethods.find --- packages/feathers/src/declarations.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/feathers/src/declarations.ts b/packages/feathers/src/declarations.ts index ee44b59fd0..43485aa2fa 100644 --- a/packages/feathers/src/declarations.ts +++ b/packages/feathers/src/declarations.ts @@ -72,7 +72,7 @@ export interface ServiceMethods< ServiceParams = Params, PatchData = Partial > { - find(params?: ServiceParams & { paginate?: PaginationParams }): Promise + find(params?: ServiceParams & { paginate?: PaginationParams }): Promise | Result[]> get(id: Id, params?: ServiceParams): Promise @@ -95,6 +95,18 @@ export interface ServiceOverloads< ServiceParams = Params, PatchData = Partial > { + find?( + params?: ServiceParams & { + paginate: false + } + ): Promise + + find?( + params?: ServiceParams & { + paginate?: PaginationOptions + } + ): Promise> + create?(data: Data[], params?: ServiceParams): Promise update?(id: Id, data: Data, params?: ServiceParams): Promise From 73fb8211e27db9fd4b02f9e41906ed18cd81814d Mon Sep 17 00:00:00 2001 From: fratzinger <22286818+fratzinger@users.noreply.github.com> Date: Thu, 22 Jun 2023 13:06:43 +0200 Subject: [PATCH 2/2] fix(transport-commons): find with Paginated --- packages/transport-commons/src/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/transport-commons/src/client.ts b/packages/transport-commons/src/client.ts index 2cf8b0a1ec..bf7a6992d9 100644 --- a/packages/transport-commons/src/client.ts +++ b/packages/transport-commons/src/client.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ import { convert } from '@feathersjs/errors' import { createDebug } from '@feathersjs/commons' -import { Id, NullableId, Params, ServiceInterface } from '@feathersjs/feathers' +import { Id, NullableId, Paginated, Params, ServiceInterface } from '@feathersjs/feathers' const debug = createDebug('@feathersjs/transport-commons/client') @@ -99,7 +99,7 @@ export class Service, P extends Params = Params> } find(params: Params = {}) { - return this.send('find', params.query || {}) + return this.send | T[]>('find', params.query || {}) } get(id: Id, params: Params = {}) {