Skip to content

Commit 14c17c0

Browse files
author
KoLiBer
committed
feat: add empty source
1 parent dc7b2d6 commit 14c17c0

File tree

13 files changed

+731
-422
lines changed

13 files changed

+731
-422
lines changed

README.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
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

docs/README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# \${PROJECT_NAME}
1+
# loopback-component-filter
22

33
## Product Owner
44

@@ -10,26 +10,21 @@
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

@@ -38,6 +33,6 @@
3833
## Links
3934

4035
[Trello]()
41-
[Gitlab]()
36+
[Gitlab](https://github.com/loopback4/loopback-component-filter)
4237

4338
## Description

sources/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
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
}

sources/src/component.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

sources/src/controllers/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

sources/src/decorators/README.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

sources/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export * from './component';
1+
export * from "./types";
2+
3+
export * from "./repositories";

sources/src/mixins/README.md

Lines changed: 0 additions & 216 deletions
This file was deleted.

0 commit comments

Comments
 (0)