Allow rating of -1 for cancel rating for rider rating user api call #162

This commit is contained in:
Kendrick Chan 2018-08-14 23:58:00 +08:00
parent f8f9bb9b7b
commit 2aa765d186

View file

@ -1332,7 +1332,20 @@ class APIController extends Controller
// TODO: check job order status, if it's complete
// add rider rating
$rating_num = $req->request->get('rating');
$rating_num = $req->request->get('rating', -1);
// if rating is -1
if ($rating_num == -1)
{
$jo->setHasRiderRating();
$em->flush();
$res->setData([]);
return $res->getReturnResponse();
}
$rating = new RiderRating();
$rating->setRider($rider)
->setCustomer($cust)