Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: dove
Choose a base branch
from

Conversation

fratzinger
Copy link
Member

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

I also added it to ServiceOverloads.

@fratzinger
Copy link
Member Author

fratzinger commented Jun 22, 2023

@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 fratzinger requested a review from daffl June 22, 2023 11:22
@daffl
Copy link
Member

daffl commented Oct 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants