8000 Fix typescript defnition of Service. All the service methods should be by harish2704 · Pull Request #573 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

Fix typescript defnition of Service. All the service methods should be#573

Merged
daffl merged 2 commits intofeathersjs:masterfrom
harish2704:master
May 9, 2017
Merged

Fix typescript defnition of Service. All the service methods should be#573
daffl merged 2 commits intofeathersjs:masterfrom
harish2704:master

Conversation

@harish2704
Copy link
Contributor

optional

Summary

As per the current type definition of Service , all the service methods are required methods.

But according to documentation, service methods are optional .
See
image

So, service definition should be something like below

  interface Service<T> extends events.EventEmitter {
    find?(params?: Params, callback?: any): Promise<T[] | Pagination<T>>;
    get?(id: number | string, params?: Params, callback?: any): Promise<T>;
    create?(data: T | T[], params?: Params, callback?: any): Promise<T | T[]>;
    update?(id: NullableId, data: T, params?: Params, callback?: any): Promise<T>;
    patch?(id: NullableId, data: any, params?: Params, callback?: any): Promise<T>;
    remove?(id: NullableId, params?: Params, callback?: any): Promise<T>;
    setup?(app?: Application, path?: string): void;
  }

I think, This pull request don't need any sort of test cases because it won't affect any other part of the application.

@eddyystop
Copy link
Contributor

Thanks for contributing! @daffl could you review?

@daffl daffl merged commit 3dcac6e into feathersjs:master May 9, 2017
@daffl
Copy link
Member
daffl commented May 9, 2017

Done and released, thank you! To mention it once again, we would still appreciate it very much if someone could take on submitting the definitions to the DefinitelyTyped repository.

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.

3 participants

0