} #[Route(path: '/api/_action/import-export/prepare', name: 'api.action.import_export.initiate', methods: ['POST'])]
public function initiate(Request
$request, Context
$context): JsonResponse
{ $profileId =
(string) $request->request->
get('profileId'
);
$expireDate =
(string) $request->request->
get('expireDate'
);
/** @var UploadedFile|null $file */
$file =
$request->files->
get('file'
);
$profile =
$this->
findProfile($context,
$profileId);
$expireDate =
new \
DateTimeImmutable($expireDate);
if ($file !== null
) { $log =
$this->importExportService->
prepareImport( $context,
$profile->
getId(),
$expireDate,
$file,
$request->request->
all('config'
),
$request->request->
has('dryRun'
) );