Skip to content

Commit 7405e82

Browse files
CarliPinellmarcoAntonioNina
authored andcommitted
Fix sort in script executor
1 parent 1f450fa commit 7405e82

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)