Closes #669
This commit is contained in:
@@ -46,8 +46,9 @@ class ApiController extends AbstractController
|
||||
*/
|
||||
public function postUpdateComponentOrder()
|
||||
{
|
||||
$componentData = Binput::all();
|
||||
foreach ($componentData['ids'] as $order => $componentId) {
|
||||
$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]);
|
||||
}
|
||||
@@ -62,8 +63,8 @@ class ApiController extends AbstractController
|
||||
*/
|
||||
public function postUpdateComponentGroupOrder()
|
||||
{
|
||||
$groupData = Binput::all();
|
||||
foreach ($groupData['ids'] as $order => $groupId) {
|
||||
$groupData = Binput::get('ids');
|
||||
foreach ($groupData as $order => $groupId) {
|
||||
ComponentGroup::find($groupId)->update([
|
||||
'order' => $order + 1,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user