Add data fields to responses where necessary. #591
This commit is contained in:
parent
deaad1dbc1
commit
8c53b9ba75
2 changed files with 7 additions and 5 deletions
|
|
@ -101,9 +101,6 @@ class CustomerController extends APIController
|
||||||
// right now, still using the old names so we use session_id name
|
// right now, still using the old names so we use session_id name
|
||||||
$data = [
|
$data = [
|
||||||
'session_id' => $mobile_user->getID(),
|
'session_id' => $mobile_user->getID(),
|
||||||
'phone_model' => $mobile_user->getPhoneModel(),
|
|
||||||
'os_version' => $mobile_user->getOSVersion(),
|
|
||||||
'phone_id' => $mobile_user->getPhoneID(),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// response
|
// response
|
||||||
|
|
@ -228,7 +225,7 @@ class CustomerController extends APIController
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: check if mobile matches mobile of customer
|
// TODO: check if mobile matches mobile of customer
|
||||||
// need to "clean" the mobile number. Mobile user stores the number with the area code prepended
|
// TODO: need to "clean" the mobile number. Mobile user stores the number with the area code prepended
|
||||||
// Customer stores the number without the area code
|
// Customer stores the number without the area code
|
||||||
$customer = $this->findCustomerByNumber($mobile_user->getPhoneNumber(), $em);
|
$customer = $this->findCustomerByNumber($mobile_user->getPhoneNumber(), $em);
|
||||||
if ($customer != null)
|
if ($customer != null)
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,11 @@ class PartnerController extends APIController
|
||||||
$em->persist($rev);
|
$em->persist($rev);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
return new APIResponse(true, 'Review added');
|
$data = [
|
||||||
|
'rating' => $rev->getRating(),
|
||||||
|
'message' => $rev->getMessage(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return new APIResponse(true, 'Review added', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue