-
Notifications
You must be signed in to change notification settings - Fork 0
Orders_get
Return all the orders of the database.
After being logged in as an administrator, go to the endpoint and you'll get the response.
This endpoint is Admin Only.
If you're using postman or insomnia to check the API remember to put the token of the logged user on the
header
, asAuthorization: Bearer <token>
.
[
{
"id": 1,
"price": 5,
"movieId": 2,
"userId": 1,
"date": "2022-02-24T14:42:47.000Z",
"createdAt": "2022-02-27T11:27:02.000Z",
"updatedAt": "2022-02-27T11:27:02.000Z"
},
{
"id": 2,
"price": 5,
"movieId": 2,
"userId": 1,
"date": "2022-02-24T14:42:47.000Z",
"createdAt": "2022-02-27T11:27:02.000Z",
"updatedAt": "2022-02-27T11:27:02.000Z"
},
{
"id": 3,
"price": 5,
"movieId": 2,
"userId": 2,
"date": "2022-02-24T14:42:47.000Z",
"createdAt": "2022-02-27T11:40:10.000Z",
"updatedAt": "2022-02-27T11:40:10.000Z"
}
]
Return the orders with movies that have a rating > 6, its rate and name, the users that made the order, his nickname and email.
After being logged in as an administrator, go to the endpoint and you'll get the response.
This endpoint is Admin Only.
If you're using postman or insomnia to check the API remember to put the token of the logged user on the
header
, asAuthorization: Bearer <token>
.
[
{
"customer": "Adult",
"nick": "adult",
"mail": "[email protected]",
"movie": "My SFW Movie",
"rating": 7
},
{
"customer": "Adult",
"nick": "adult",
"mail": "[email protected]",
"movie": "My SFW Movie",
"rating": 7
},
{
"customer": "Underage",
"nick": "kid",
"mail": "[email protected]",
"movie": "My SFW Movie",
"rating": 7
}
]
Return the order with the passed pk.
After being logged in, go to the endpoint and you'll get the response.
If you're using postman or insomnia to check the API remember to put the token of the logged user on the
header
, asAuthorization: Bearer <token>
.
{
"id": 1,
"price": 5,
"movieId": 2,
"userId": 1,
"date": "2022-02-24T14:42:47.000Z",
"createdAt": "2022-02-27T11:27:02.000Z",
"updatedAt": "2022-02-27T11:27:02.000Z"
}