Skip to content

Commit d1df158

Browse files
authored
Merge pull request #7807 from ProcessMaker/bugfix/FOUR-19358
bugfix/FOUR-19358: [40847] Bug: Sorting Functionality Not Working for Script Executors in Admin Panel
2 parents 923b7d0 + ddc0986 commit d1df158

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ProcessMaker/Http/Controllers/Api/ScriptExecutorController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ public function index(Request $request)
5959
{
6060
$this->checkAuth($request);
6161

62-
return new ApiCollection(ScriptExecutor::nonSystem()->get());
62+
$query = ScriptExecutor::nonSystem();
63+
64+
if ($request->has('order_by')) {
65+
$order_by = $request->input('order_by');
66+
$order_direction = $request->input('order_direction', 'ASC');
67+
$query->orderBy($order_by, $order_direction);
68+
}
69+
70+
return new ApiCollection($query->get());
6371
}
6472

6573
/**

0 commit comments

Comments
 (0)