/** * Импортируем файл * @param array $data * @param null|array $params * @return array */ public function importAction(array $data, ?array $params = []): array { try { ... } catch (\Throwable $th) { $this->addError(new Error($th->getMessage(), $th->getCode())); } return $file; } |
const data = document.getElementById(); // data = BX.ajax.runComponentAction('company:sale.basket.detail', 'import', { mode: 'ajax', data: {data}, }) ?.then(response => {...}) .catch(response => {...}) |