Skip to content

Commit 6c2eea1

Browse files
author
Alexander Kharkovey
committed
feat(json-api-nestjs): with readme
1 parent f267104 commit 6c2eea1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

libs/json-api-nestjs/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ For using swagger, you should only add [@nestjs/swagger](https://docs.nestjs.com
100100
## Available endpoint method
101101
Using **Users** entity and relation **Roles** entity as example
102102

103-
include
104-
105-
106103
### List item of Users
107-
GET /users
104+
105+
```
106+
GET /users
107+
```
108108
Available query params:
109109

110110
- **include** - you can extend result with relations (aka join)
@@ -115,28 +115,28 @@ Available query params:
115115

116116
- **fields** - you can specify required fields of result query
117117

118-
- ```
118+
```
119119
GET /users?fields[target]=login,lastName&fileds[roles]=name,key
120120
```
121121
The "target" is **Users** entity
122122
The "roles" is **Roles** entity
123123
So, result of request will be have only fields *login* and *lastName* for **Users** entity and fields *name* and *key* for **Roles** entity
124124
- **sort** - you can sort result of the request
125125

126-
- ```
126+
```
127127
GET /users?sort=target.name,-roles.key
128128
```
129129
The "target" is **Users** entity
130130
The "roles" is **Roles** entity
131131
So, result of the request will be sorted by field *name* of **Users** by *ASC* and field *key* of **Roles** entity by **DESC**.
132132
- **page** - pagination for you request
133133

134-
- ```
134+
```
135135
GET /users?page[number]=1page[size]=20
136136
```
137137
- **filter** - filter for query
138138

139-
- ```
139+
```
140140
GET /users?filter[name][eq]=1&filter[roles.name][ne]=test&filter[roles.status][eq]=true
141141
```
142142
The "name" is a field of **Users** entity

0 commit comments

Comments
 (0)