-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4822810
commit dd8a2ed
Showing
5 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add film to favorite film list | ||
|
||
## Description | ||
|
||
Download excel file with list of characters and films they took part. | ||
|
||
<b>URL:</b> `/favorites/:id/file` | ||
|
||
<b>Method:</b> `GET` | ||
|
||
## Success Response | ||
|
||
Code: `200 OK` | ||
|
||
Condition: If favorite films list with provided correctly id exist. | ||
|
||
### Context example | ||
|
||
[Characters list](../example/characters.xlsx) | ||
|
||
## Error Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Get products | ||
# Get films | ||
|
||
## Description | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Add film to favorite film list | ||
|
||
## Description | ||
|
||
Add film to favorite film list and save in database. | ||
|
||
<b>URL:</b> `/favorites` | ||
|
||
<b>Method:</b> `POST` | ||
|
||
## Data constraints | ||
|
||
```json | ||
{ | ||
"id": "[integer]", | ||
"name": "[string]" | ||
} | ||
``` | ||
|
||
## Data example | ||
|
||
```json | ||
{ | ||
"id": 2, | ||
"name": "Angel Saga" | ||
} | ||
``` | ||
|
||
## Success Response | ||
|
||
Code: `200 OK` | ||
|
||
Condition: If film with provided correctly id exist. | ||
|
||
Return added film with corresponding array of characters and list to which film was added\*. | ||
|
||
\* if list with provided name doesn't exist it will be created containing film in database. | ||
|
||
### Context example | ||
|
||
```json | ||
{ | ||
"film": { | ||
"characters": [ | ||
"Luke Skywalker", | ||
"C-3PO", | ||
"R2-D2", | ||
"Darth Vader", | ||
"Leia Organa", | ||
"Owen Lars", | ||
"Beru Whitesun lars", | ||
"R5-D4", | ||
"Biggs Darklighter", | ||
"Obi-Wan Kenobi", | ||
"Wilhuff Tarkin", | ||
"Chewbacca", | ||
"Han Solo", | ||
"Greedo", | ||
"Jabba Desilijic Tiure", | ||
"Wedge Antilles", | ||
"Jek Tono Porkins", | ||
"Raymus Antilles" | ||
], | ||
"release_date": "1977-05-25", | ||
"title": "A New Hope" | ||
}, | ||
"filmList": { | ||
"id": 1, | ||
"name": "Angel Saga" | ||
} | ||
} | ||
``` | ||
|
||
## Error Response | ||
|
||
Code: `404 NOT FOUND` | ||
|
||
Condition: If provided id is incorrect. | ||
|
||
```json | ||
{ | ||
"err": "id has to be number", | ||
"fail": true | ||
} | ||
``` |
Binary file not shown.