Skip to content

Commit

Permalink
Add count methods to the Model types
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallswain committed Sep 2, 2020
1 parent 9f0c137 commit 2988f9e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/service-module/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,17 @@ export interface ModelStatic extends EventEmitter {
*/
findInStore<M extends Model = Model>(params?: Params): Paginated<M>

/**
* A proxy for the `count` action
* @param params Find params
*/
count<M extends Model = Model>(params?: Params): Promise<M[] | Paginated<M>>
/**
* A proxy for the `count` getter
* @param params Find params
*/
countInStore<M extends Model = Model>(params?: Params): Paginated<M>

/**
* A proxy for the `get` action
* @param id ID of record to retrieve
Expand Down

0 comments on commit 2988f9e

Please sign in to comment.