We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 923b7d0 + ddc0986 commit d1df158Copy full SHA for d1df158
ProcessMaker/Http/Controllers/Api/ScriptExecutorController.php
@@ -59,7 +59,15 @@ public function index(Request $request)
59
{
60
$this->checkAuth($request);
61
62
- return new ApiCollection(ScriptExecutor::nonSystem()->get());
+ $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());
71
}
72
73
/**
0 commit comments