Added 'attendants_number' setting to REST API (#109).

This commit is contained in:
Alex Tselegidis 2016-07-21 21:00:38 +02:00
parent b35ab3bbe3
commit 6d081ad471
2 changed files with 8 additions and 2 deletions

View file

@ -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
}
```

View file

@ -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'];
}