@@ -93,7 +93,7 @@ curl --location --request POST 'http://localhost:4080/user/login' \
9393
9494```
9595curl --location --request GET 'http://localhost:4080/user/me ' \
96- --header 'token: eyJhbGci....blSXAPm0'
96+ --header 'x-access- token: eyJhbGci....blSXAPm0'
9797
9898```
9999**Returns**
@@ -116,19 +116,16 @@ curl --location --request GET 'http://localhost:4080/user/me' \
116116
117117# Report
118118
119- ## /report
120-
121- This let to add a result test report. Use auth-user-type to inform the type of user:
122- - 0 = internal registered user
123- - 1 = google user
119+ ## POST: /report
124120
121+ This let to add a result test to the report table.
125122
126123```
127124curl --location --request POST 'http://localhost:4080/report ' \
128125--header 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWU4ODhhZDBlZGEwN2U2ZGFlYjY0ODBiIn0sImlhdCI6MTU4NjAxNjA2MiwiZXhwIjoxNTg2MDE5NjYyfQ.hmxFFAz1P80Yq4Q2iA6D8IpCOhI5_7xkfZYWDkQOHK4' \
129126--header 'Content-Type: application/json' \
130127--data-raw '{
131- "idUser": "1 ",
128+ "idUser": "'9365df4e9acef8b63b45dc3534491225ac32630abe6991f6bf5a74c9803412fc' ",
132129 "testDate": "03/02/2020",
133130 "testResult": 0
134131}'
@@ -149,6 +146,36 @@ curl --location --request POST 'http://localhost:4080/report' \
149146}
150147```
151148
149+ ## GET: /report/{idUser}
150+
151+ Get the list of reported tests
152+
153+
154+ ```
155+ curl --location --request GET 'http://localhost:4080/report/9365df4e9acef8b63b45dc3534491225ac32630abe6991f6bf5a74c9803412fc ' \
156+ --header 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWU4ODhhZDBlZGEwN2U2ZGFlYjY0ODBiIn0sImlhdCI6MTU4NjI4Njg4MiwiZXhwIjoxNTg2MjkwNDgyfQ.zVNwkDZCXtlxRJnDhonptMxbgpngrB3T7cNIy8vde_I'
157+ ```
158+ **Returns**
159+
160+ ```
161+ {
162+ "reports": [
163+ {
164+ "createdAt": "2020-04-07T19:24:31.388Z",
165+ "_ id": "5e8cd38dc43d8007408e600d",
166+ "idUser": "9365df4e9acef8b63b45dc3534491225ac32630abe6991f6bf5a74c9803412fc",
167+ "testDate": "2020-03-04T03:00:00.000Z",
168+ "testResult": 1,
169+ "idReport": 17,
170+ "__ v": 0
171+ },
172+ {
173+ ...
174+ }
175+ ]
176+ }
177+ ```
178+
152179# Migrations
153180source: https://www.npmjs.com/package/migrate-mongo
154181
0 commit comments