/api/review
POST
road_id
(int): The ID of the road being reviewed.description
(string): The description of the review.rating
(int): Rating of the road (1-5).200 OK
400 Bad Request
— {'message': 'bad data'}
404 Not Found
— {'message': 'road not found'}
/api/review
GET
200 OK
— List of all reviews in JSON404 Not Found
— {'message': 'Reviews not found'}
/api/review
PUT
id
(int): Review IDdescription
(string): Updated textrating
(int): Updated score (1-5)200 OK
— Updated review in JSON404
— {'message': 'review not found'}
401
— {'message': 'can not update review'}
/api/review
DELETE
id
(int): ID of the review200 OK
— { "message": "Road removed", "deleted": true }
401
— { "message": "Road not deleted wrong user", "deleted": false }
404
— { "message": "review not found" }
Request:
POST /api/review
Content-Type: application/json
Authorization: Bearer <your_token>
{
"road_id": 1,
"description": "The road is in good condition.",
"rating": 5
}
Response:
{
"id": 123,
"user_id": 1,
"road_id": 1,
"description": "The road is in good condition.",
"rating": 5,
"created_at": "2025-04-25T00:00:00Z"
}