File tree 1 file changed +11
-13
lines changed
1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
1
# loopback-component-filter
2
2
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 )
4
7
5
8
Using this simple extension you can filter models in repository level.
6
9
@@ -41,19 +44,14 @@ import { FilterRepositoryMixin } from "loopback-component-filter";
41
44
42
45
export class UserRepository extends FilterRepositoryMixin <
43
46
User ,
44
- string ,
47
+ typeof User . prototype . id ,
45
48
UserRelations
46
49
>({
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
+ ) {
57
55
// ...
58
56
}
59
57
```
@@ -66,5 +64,5 @@ export class UserRepository extends FilterRepositoryMixin<
66
64
67
65
## License
68
66
69
- This project is licensed under the [ MIT license] ( LICENSE ) .
67
+ This project is licensed under the [ MIT license] ( LICENSE.md ) .
70
68
Copyright (c) KoLiBer (
[email protected] )
You can’t perform that action at this time.
0 commit comments