File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 11# loopback-component-filter
22
3- [ ![ Build Status] ( https://travis-ci.com/loopback4/loopback-component-filter.svg?branch=master )] ( https://travis-ci.com/loopback4/loopback-component-filter )
3+ ![ Travis (.org) branch] ( https://img.shields.io/travis/loopback4/loopback-component-filter/master )
4+ ![ npm] ( https://img.shields.io/npm/v/loopback-component-filter )
5+ ![ npm bundle size] ( https://img.shields.io/bundlephobia/min/loopback-component-filter )
6+ ![ GitHub] ( https://img.shields.io/github/license/loopback4/loopback-component-filter )
47
58Using this simple extension you can filter models in repository level.
69
@@ -41,19 +44,14 @@ import { FilterRepositoryMixin } from "loopback-component-filter";
4144
4245export class UserRepository extends FilterRepositoryMixin <
4346 User ,
44- string ,
47+ typeof User . prototype . id ,
4548 UserRelations
4649>({
47- id: " id" ,
48- where : async (
49- context ,
50- where
51- ) => where ;
52- fields : async (
53- context ,
54- fields
55- ) => fields ;
56- })() {
50+ where : async (context , where ) => where ,
51+ fields : async (context , fields ) => fields ,
52+ })<Constructor <DefaultCrudRepository <User , string , UserRelations >>>(
53+ DefaultCrudRepository
54+ ) {
5755 // ...
5856}
5957```
@@ -66,5 +64,5 @@ export class UserRepository extends FilterRepositoryMixin<
6664
6765## License
6866
69- This project is licensed under the [ MIT license] ( LICENSE ) .
67+ This project is licensed under the [ MIT license] ( LICENSE.md ) .
7068Copyright (c) KoLiBer (
[email protected] )
You can’t perform that action at this time.
0 commit comments