Skip to content

Commit

Permalink
readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciechszmelczerczyk committed Dec 11, 2022
1 parent 4822810 commit dd8a2ed
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/getFavorites.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Get products
# Get favorite film lists

## Description

Get all favorite films lists.
Get all favorite film lists.

<b>URL :</b> `/favorites`

Expand Down
21 changes: 21 additions & 0 deletions docs/getFileFavorite.md
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
2 changes: 1 addition & 1 deletion docs/getFilms.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Get products
# Get films

## Description

Expand Down
85 changes: 85 additions & 0 deletions docs/post.md
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 added example/characters.xlsx
Binary file not shown.

0 comments on commit dd8a2ed

Please sign in to comment.