Skip to content

Commit 999ad17

Browse files
committed
fix: custom ajax action
1 parent 8f388e3 commit 999ad17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Services/DataTable.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,6 @@ public function __construct()
172172
*/
173173
public function render(?string $view = null, array $data = [], array $mergeData = [])
174174
{
175-
if ($this->request()->ajax() && $this->request()->wantsJson()) {
176-
return app()->call($this->ajax(...));
177-
}
178-
179175
/** @var string $action */
180176
$action = $this->request()->get('action');
181177
$actionMethod = $action === 'print' ? 'printPreview' : $action;
@@ -187,6 +183,10 @@ public function render(?string $view = null, array $data = [], array $mergeData
187183
return app()->call($callback);
188184
}
189185

186+
if ($this->request()->ajax() && $this->request()->wantsJson()) {
187+
return app()->call($this->ajax(...));
188+
}
189+
190190
/** @phpstan-ignore-next-line */
191191
return view($view, $data, $mergeData)->with($this->dataTableVariable, $this->getHtmlBuilder());
192192
}

0 commit comments

Comments
 (0)