Vote Restaurant - MarcoLagalla/marette_backend GitHub Wiki

Name Vote Restaurant
Description Allow customer to vote once a Restaurant
URL api/v1/webapp/restaurant/int:id/vote
Allowed methods POST
Authorizations IsAuthenticated, IsCustomer, CustomerActivated

POST


Allows customer to vote only once each restaurant.

Field Type Required Unique Comments
vote numeric yes no vote can be between 0-5
{
	"vote": "5"
}

And in case of success, returns :

{
    "success": [
        "Grazie per aver votato questo ristorante."
    ]
}

Return codes

Status Description
HTTP_201_CREATED If the vote is valid
HTTP_404_NOT_FOUND restaurant or customer not found
HTTP_403_FORBIDDEN If not authorized
HTTP_400_BAD_REQUEST if vote is not valid
⚠️ **GitHub.com Fallback** ⚠️