Skip to content

Commit

Permalink
chore: updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
benborla committed Nov 18, 2023
1 parent 49fdc36 commit 8fd8147
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ Usage: `php bin/console fruits:fetch`
| ------ | ------ |
| fruits:fetch | Sync database from API source, optional parameter `--truncate={bool}` |



## API Endpoints


### Get all `fruits` resources

Method: **GET**

Endpoint: `/`

Parameters:
- page: for pagination, which page should it return
- size: how many rows it should return
Expand All @@ -57,14 +63,22 @@ Parameters:

Sample Usage: `/?size=5&page=2`


### Get `fruit` resource

Method: **GET**

Endpoint: `/fruit/:id `

Parameters: id


### Create `fruit` resource

Method: **POST** or **PUT**

Endpoint: `/fruit`

Sample Payload:
```json
{
Expand All @@ -80,10 +94,15 @@ Sample Payload:
}
```


### Update `fruit` resource

Method: **POST** or **PATCH**

Endpoint: `/fruit/:id `

Parameters: id

Sample Payload:
```json
{
Expand All @@ -93,21 +112,36 @@ Sample Payload:
```
*Only provide the properties that needs to be updated.*


### Delete `fruit` resource

Method: **DELETE**

Endpoint: `/fruit/:id `

Parameters: id


### Get all `favorites` resources

Method: **GET**

Endpoint: `/favorites`


### Add `fruit` in `favorite` resource

Method: **POST**

Endpoint: `/favorites/:fruitId`

Parameter: **fruitId**


### Remove `fruit` in `favorite` resource

Method: **DELETE**

Endpoint: `/favorite/:fruitId `

Parameters: fruitId

0 comments on commit 8fd8147

Please sign in to comment.