feathers icon indicating copy to clipboard operation
feathers copied to clipboard

fix(feathers): Paginated<Result> for ServiceMethods.find

Open fratzinger opened this issue 2 years ago • 2 comments

The ReturnType of ServiceMethods['find'] was Promise<Result | Result[]>. The correct way is Promise<Paginated<Result> | Result[]>.

I also added it to ServiceOverloads.

fratzinger avatar Jun 22 '23 11:06 fratzinger

@daffl: I'm stuck with the error. The service OAuthService in @feathersjs/authentication-oauth does not follow the common service definition. OAuthService['find'] returns Promise<GrantResponse>.

It has to follow the common service definition, which should be Promise<Paginated<R> | R[]>. That is what the current error is about.

see Pipeline: image and Code: image

How to continue?

  1. use @ts-ignore to move on?
  2. make OAuthService['find'] to return an array or a paginated result?
  3. rename find of OAuthService to anything else?

fratzinger avatar Jun 22 '23 11:06 fratzinger

I'm not sure if we can add the pagination options to the main interface - I believe that's the error that is happening since any service interface implementor now expects the pagination overloads to be implement.

daffl avatar Oct 11 '23 02:10 daffl