-
Notifications
You must be signed in to change notification settings - Fork 0
Movies_get
Return all the movies of the database.
Go to the endpoint and you'll get the response.
[
{
"id": 1,
"title": "My Movie",
"description": "This is a movie",
"adult": true,
"popularity": 7,
"image": "http:/your.site/image-folder/any.jpg",
"date": "2022-02-24 15:42:47",
"createdAt": "2022-02-26T22:29:05.000Z",
"updatedAt": "2022-02-26T22:29:05.000Z"
},
{
"id": 2,
"title": "My SFW Movie",
"description": "This is a movie for the family",
"adult": false,
"popularity": 7,
"image": "http:/your.site/image-folder/any.jpg",
"date": "2022-02-24 15:42:47",
"createdAt": "2022-02-26T20:18:37.000Z",
"updatedAt": "2022-02-26T20:18:37.000Z"
}
]
Return all adult movies with specified title and popularity of the database.
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>
.
?title=<string>&adult=<boolean>&popularity=<float>
All the fields needs to exists on the database.
adult
will be 0
or 1
, being false
and true
respectively.
popularity
needs to be a number between 0 and 10.
[
{
"id": 1,
"title": "My Movie",
"description": "This is a movie",
"adult": true,
"popularity": 7,
"image": "http:/your.site/image-folder/any.jpg",
"date": "2022-02-24 15:42:47",
"createdAt": "2022-02-26T22:29:05.000Z",
"updatedAt": "2022-02-26T22:29:05.000Z"
}
]
Return all the adult movies of the database.
After being logged in, go to the endpoint and you'll get the response IF the user has more than 18yo.
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,
"title": "My Movie",
"description": "This is a movie",
"adult": true,
"popularity": 7,
"image": "http:/your.site/image-folder/any.jpg",
"date": "2022-02-24 15:42:47",
"createdAt": "2022-02-26T22:29:05.000Z",
"updatedAt": "2022-02-26T22:29:05.000Z"
},
{
"id": 3,
"title": "One NSFW Movie",
"description": "This is a movie for the lewds",
"adult": true,
"popularity": 7,
"image": "http:/your.site/image-folder/any.jpg",
"date": "2022-02-24 15:42:47",
"createdAt": "2022-02-26T20:18:37.000Z",
"updatedAt": "2022-02-26T20:18:37.000Z"
}
]
Return one movie of the database, if the movie is for adult it will return just for adult users.
After being logged in, go to the endpoint and you'll get the response, if the movie is for adults
the user
will need to have more than 18yo
to access.
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,
"title": "My Movie",
"description": "This is a movie",
"adult": true,
"popularity": 7,
"image": "http:/your.site/image-folder/any.jpg",
"date": "2022-02-24 15:42:47",
"createdAt": "2022-02-26T22:29:05.000Z",
"updatedAt": "2022-02-26T22:29:05.000Z"
}