Fixed issues with the api controller

This commit is contained in:
Graham Campbell
2015-05-27 17:02:17 +01:00
parent 502ae9d2a0
commit d29b872fee

View File

@@ -47,7 +47,7 @@ class ApiController extends AbstractController
public function postUpdateComponentOrder()
{
$componentData = Binput::get('ids');
return $componentData;
foreach ($componentData as $order => $componentId) {
// Ordering should be 1-based, data comes in 0-based
Component::find($componentId)->update(['order' => $order + 1]);
@@ -64,6 +64,7 @@ class ApiController extends AbstractController
public function postUpdateComponentGroupOrder()
{
$groupData = Binput::get('ids');
foreach ($groupData as $order => $groupId) {
ComponentGroup::find($groupId)->update([
'order' => $order + 1,