File tree Expand file tree Collapse file tree 13 files changed +731
-422
lines changed Expand file tree Collapse file tree 13 files changed +731
-422
lines changed Original file line number Diff line number Diff line change 1- # \$ {PROJECT_NAME}
1+ # loopback-component-filter
22
3- \$ {PROJECT_DESCRIPTION}
3+ Using this simple extension you can filter models in repository level.
44
5- ## Dependencies
5+ ---
6+
7+ ## Installation
68
7- \$ {PROJECT_MODULES}
9+ ``` bash
10+ npm i --save loopback-component-filter
11+ ```
812
913---
1014
11- ## Building
15+ ## Usage
1216
13- \$ {PROJECT_BUILD}
17+ ### Filter Repository Mixin
1418
15- ---
19+ Change your repository parent class from ` DefaultCrudRepository ` to ` FilterCrudRepositoryMixin(configs)() `
20+
21+ #### Example
22+
23+ Change your repository from:
24+
25+ ``` ts
26+ export class UserRepository extends DefaultCrudRepository <
27+ User ,
28+ typeof User .prototype .id ,
29+ UserRelations
30+ > {
31+ // ...
32+ }
33+ ```
34+
35+ To:
1636
17- ## Testing
37+ ``` ts
38+ import { FilterCrudRepositoryMixin } from " loopback-component-filter" ;
1839
19- \$ {PROJECT_BUILD_ASSCINEMA_REC}
40+ export class UserRepository extends FilterCrudRepositoryMixin <
41+ User ,
42+ UserRelations
43+ >(configs )() {
44+ // ...
45+ }
46+ ```
2047
2148---
2249
Original file line number Diff line number Diff line change 1- # \$ {PROJECT_NAME}
1+ # loopback-component-filter
22
33## Product Owner
44
1010
1111## Start Date (UTC)
1212
13- - \$ {PROJECT_DATE}
13+ - 2020-05-02T08:23:39.598Z
1414
1515## Question
1616
17- - \$ {PROJECT_QUESTION}
17+ - How to filter models in repository layer ?
1818
1919## Goal
2020
21- - \$ {PROJECT_GOAL}
21+ - Implement a filter in repository layer
2222
2323## Languages and Frameworks
2424
25- 1 . ** Client**
26- 1 . ** HTML5**
27- 2 . ** CSS3**
28- 3 . ** JavaScript-ES7**
29- 4 . ** React.js**
30- 2 . ** Server**
25+ 1 . ** Server**
3126 1 . ** Node.js**
32- 2 . ** Express.js **
27+ 2 . ** Loopback 4 **
3328
3429## SDLC (Software Development Life Cycle)
3530
3833## Links
3934
4035[ Trello] ( )
41- [ Gitlab] ( )
36+ [ Gitlab] ( https://github.com/loopback4/loopback-component-filter )
4237
4338## Description
Original file line number Diff line number Diff line change 3636 "@loopback/boot" : " ^2.1.2" ,
3737 "@loopback/context" : " ^3.6.0" ,
3838 "@loopback/core" : " ^2.4.2" ,
39+ "@loopback/repository" : " ^2.3.0" ,
3940 "tslib" : " ^1.10.0"
4041 },
4142 "devDependencies" : {
4243 "@loopback/build" : " ^5.3.0" ,
43- "source-map-support" : " ^0.5.19" ,
4444 "@loopback/testlab" : " ^3.1.2" ,
4545 "@types/node" : " ^10.17.21" ,
46+ "nodemon" : " ^2.0.3" ,
47+ "source-map-support" : " ^0.5.19" ,
4648 "typescript" : " ~3.8.3"
4749 }
4850}
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- export * from './component' ;
1+ export * from "./types" ;
2+
3+ export * from "./repositories" ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments