Add data fields to responses where necessary. #591

This commit is contained in:
Korina Cordero 2021-07-14 10:27:14 +00:00
parent deaad1dbc1
commit 8c53b9ba75
2 changed files with 7 additions and 5 deletions

View file

@ -101,9 +101,6 @@ class CustomerController extends APIController
// right now, still using the old names so we use session_id name
$data = [
'session_id' => $mobile_user->getID(),
'phone_model' => $mobile_user->getPhoneModel(),
'os_version' => $mobile_user->getOSVersion(),
'phone_id' => $mobile_user->getPhoneID(),
];
// response
@ -228,7 +225,7 @@ class CustomerController extends APIController
}
// 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 = $this->findCustomerByNumber($mobile_user->getPhoneNumber(), $em);
if ($customer != null)

View file

@ -190,6 +190,11 @@ class PartnerController extends APIController
$em->persist($rev);
$em->flush();
return new APIResponse(true, 'Review added');
$data = [
'rating' => $rev->getRating(),
'message' => $rev->getMessage(),
];
return new APIResponse(true, 'Review added', $data);
}
}