Components can now be re-ordered, closes #165
This commit is contained in:
@@ -19,4 +19,19 @@ class DashAPIController extends Controller
|
||||
App::abort(500);
|
||||
}
|
||||
}
|
||||
|
||||
public function postUpdateComponentOrder()
|
||||
{
|
||||
$componentData = Input::all();
|
||||
unset($componentData['component'][0]); // Remove random 0 index.
|
||||
|
||||
foreach ($componentData['component'] as $componentId => $order) {
|
||||
$component = Component::find($componentId);
|
||||
$component->update([
|
||||
'order' => $order
|
||||
]);
|
||||
}
|
||||
|
||||
return $componentData;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user