Components can now be re-ordered, closes #165

This commit is contained in:
James Brooks
2015-01-01 13:37:47 +00:00
parent 925818320c
commit 6ab16f98ab
17 changed files with 35878 additions and 44 deletions
+15
View File
@@ -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;
}
}