← All changes
|
backend/src/Controllers/Entry/GetEntryController.php
+5
-1
1.1.1
→
1.5.1
View file →
| @@ -11,8 +11,9 @@ | ||
| 11 | 11 | use IvyForms\Common\Exceptions\InvalidArgumentException; |
| 12 | 12 | use IvyForms\Common\Exceptions\NotFoundException; |
| 13 | 13 | use IvyForms\Common\Sanitizer\Sanitizer; |
| 14 | 14 | use IvyForms\Controllers\Controller; |
| 15 | +use IvyForms\Services\Amelia\AmeliaService; | |
| 15 | 16 | use IvyForms\Services\Entry\EntryService; |
| 16 | 17 | use IvyForms\Services\Translations\BackendStrings; |
| 17 | 18 | use WP_REST_Request; |
| 18 | 19 | use WP_REST_Response; |
| @@ -24,12 +25,14 @@ | ||
| 24 | 25 | */ |
| 25 | 26 | class GetEntryController extends Controller |
| 26 | 27 | { |
| 27 | 28 | private EntryService $entryService; |
| 29 | + private AmeliaService $ameliaService; | |
| 28 | 30 | |
| 29 | - public function __construct(EntryService $entryService) | |
| 31 | + public function __construct(EntryService $entryService, AmeliaService $ameliaService) | |
| 30 | 32 | { |
| 31 | 33 | $this->entryService = $entryService; |
| 34 | + $this->ameliaService = $ameliaService; | |
| 32 | 35 | } |
| 33 | 36 | |
| 34 | 37 | /** |
| 35 | 38 | * @param WP_REST_Request $data |
| @@ -54,8 +57,9 @@ | ||
| 54 | 57 | $entryId = Sanitizer::sanitizeId($data->get_param('id')); |
| 55 | 58 | |
| 56 | 59 | $entry = $this->entryService->getEntryManager()->getEntry($entryId); |
| 57 | 60 | $entryArray = $entry->toArray(); |
| 61 | + $entryArray['ameliaBookingUrls'] = $this->ameliaService->getBookingUrlsByEntryId($entryId); | |
| 58 | 62 | |
| 59 | 63 | $entryFields = $this->entryService->getEntryFieldManager()->getEntryFields([$entryArray]); |
| 60 | 64 | |
| 61 | 65 | return new WP_REST_Response([ |