← All changes
|
backend/src/Controllers/Form/ImportFormController.php
+3
-4
1.1.1
→
1.5.1
View file →
| @@ -3,9 +3,8 @@ | ||
| 3 | 3 | namespace IvyForms\Controllers\Form; |
| 4 | 4 | |
| 5 | 5 | use IvyForms\Common\Exceptions\ForbiddenException; |
| 6 | 6 | use IvyForms\Common\Exceptions\InvalidArgumentException; |
| 7 | -use IvyForms\Common\Helpers\FormImportValidator; | |
| 8 | 7 | use IvyForms\Common\Sanitizer\Sanitizer; |
| 9 | 8 | use IvyForms\Controllers\Controller; |
| 10 | 9 | use IvyForms\Services\Form\FormImportExportService; |
| 11 | 10 | use IvyForms\Services\Translations\BackendStrings; |
| @@ -31,12 +30,12 @@ | ||
| 31 | 30 | */ |
| 32 | 31 | public function handle(WP_REST_Request $data): WP_REST_Response |
| 33 | 32 | { |
| 34 | 33 | Sanitizer::verifyNonce($data->get_header('X-WP-Nonce')); |
| 35 | - $formsData = FormImportValidator::validateImportPayload($data->get_param('importData')); | |
| 36 | 34 | |
| 37 | - // Import forms using service | |
| 38 | - $importedForms = $this->importExportService->importForms($formsData); | |
| 35 | + $importedForms = $this->importExportService->importFromRawPayload( | |
| 36 | + $data->get_param('importData') | |
| 37 | + ); | |
| 39 | 38 | if (empty($importedForms)) { |
| 40 | 39 | throw new InvalidArgumentException( |
| 41 | 40 | BackendStrings::getCommonStrings()['no_forms_imported'] |
| 42 | 41 | ); |