mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 22:52:35 +03:00
Added 'attendants_number' setting to REST API (#109).
This commit is contained in:
parent
b35ab3bbe3
commit
6d081ad471
2 changed files with 8 additions and 2 deletions
|
@ -187,6 +187,7 @@ You can also try the GET requests with your browser by navigating to the respeci
|
|||
"currency": "Euro",
|
||||
"description": "Male haircut trends.",
|
||||
"availabilitiesType": "flexible",
|
||||
"attendantsNumber": 1,
|
||||
"categoryId": null
|
||||
}
|
||||
```
|
||||
|
|
|
@ -28,11 +28,12 @@ class Services implements ParsersInterface {
|
|||
$encodedResponse = [
|
||||
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
||||
'name' => $response['name'],
|
||||
'duration' => $response['duration'],
|
||||
'price' => $response['price'],
|
||||
'duration' => (int)$response['duration'],
|
||||
'price' => (float)$response['price'],
|
||||
'currency' => $response['currency'],
|
||||
'description' => $response['description'],
|
||||
'availabilitiesType' => $response['availabilities_type'],
|
||||
'attendantsNumber' => (int)$response['attendants_number'],
|
||||
'categoryId' => $response['id_service_categories'] !== null ? (int)$response['id_service_categories'] : null
|
||||
];
|
||||
|
||||
|
@ -76,6 +77,10 @@ class Services implements ParsersInterface {
|
|||
$decodedRequest['availabilities_type'] = $request['availabilitiesType'];
|
||||
}
|
||||
|
||||
if (!empty($request['attendantsNumber'])) {
|
||||
$decodedRequest['attendants_number'] = $request['attendantsNumber'];
|
||||
}
|
||||
|
||||
if (!empty($request['categoryId'])) {
|
||||
$decodedRequest['id_service_categories'] = $request['categoryId'];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue