Closed eddie-2020 closed 2 years ago
http://localhost:3000/api/v1/reservations
, should return all reservationshttp://localhost:3000/api/v1/reservation/1
, should return a single reservation
{
user: {
"id": 2,
"photo": "https://lh3.googleusercontent.com/a-/AFdZucr30ljEL5GxFopjvqkvsMs_V9RGIGth2ldxwcNxJQ=s96-c",
"username": "Dagi Zewdu",
"email": "dagi.zewdu.dz@gmail.com",
"created_at": "2022-07-14T08:42:06.174Z",
"updated_at": "2022-07-14T08:42:06.174Z"
},
motorcycle :{
"id": 8,
"title": "Vespas v-18",
"model": "elas user-2",
"description": "Vespas blaba",
"cylinder": 2,
"acceleration": "80MHP to 100 MHP",
"price": 8800.0,
"duration": 8,
"discount": 0,
"user_id": 1,
"created_at": "2022-07-15T07:07:48.774Z",
"updated_at": "2022-07-15T07:08:29.574Z",
"images": [
"ur1",
"ur2"
],
"created_by": {
"id": 1,
"photo": "12345678",
"username": "dagic",
"email": "ezward.zewdu.dz@gmail.com",
"created_at": "2022-07-13T20:42:12.105Z",
"updated_at": "2022-07-13T20:42:12.105Z"
}
},
phone: "980345"
}
http://localhost:3000/api/v1/reservation
the body should look accept the following body and save it to the database
{
"user_id":1, // required
"motorcycle_id":1, // required
"phone": string, // optional
}
http://localhost:3000/api/v1/getreservation
the body should accept the following
{
"user_id":1, // optional
"motorcycle_id":1, // optional
}
put
endpoint http://localhost:3000/api/v1/reservation/1
. The body should look accept the following body and save it to the database. Remember always compare the creator of the reservation with the token provided.
{
"user_id":1, // required
"motorcycle_id":1, // required
"phone": string, // optional
}
delete
endpoint with http://localhost:3000/api/v1/reservation/1
to delete the reservation . Remember always compare the creator of the reservation with the token provided.
http://localhost:3000/reservation/1