mirror of
https://github.com/bspeice/UNCCGameDay-Server
synced 2024-12-04 13:58:14 -05:00
Display the rating choice options
This commit is contained in:
parent
4b338c220e
commit
f094673ecc
@ -17,12 +17,19 @@ class ParkingLotList(APIView):
|
|||||||
|
|
||||||
class RateLot(APIView):
|
class RateLot(APIView):
|
||||||
"""
|
"""
|
||||||
Rate a parking lot
|
Rate a parking lot
|
||||||
|
**GET**: Get the rating choice options
|
||||||
|
**POST**: Rate a parking lot
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
|
'Rate a parking lot'
|
||||||
rating = ParkingRatingSerializer(data=request.DATA)
|
rating = ParkingRatingSerializer(data=request.DATA)
|
||||||
if rating.is_valid():
|
if rating.is_valid():
|
||||||
rating.save()
|
rating.save()
|
||||||
return Response(rating.data)
|
return Response(rating.data)
|
||||||
return Response(rating.errors, status=status.HTTP_400_BAD_REQUEST)
|
return Response(rating.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
def get(self, request):
|
||||||
|
'Get the rating choice options'
|
||||||
|
return Response(ParkingRating.RATING_CHOICES)
|
Loading…
Reference in New Issue
Block a user