X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4791db863d4fa954318024ea1d79e62572ae2eb1..15f58ff3dfd79651a95535b53f864ea0e8cb6620:/SL/Controller/Warehouse.pm diff --git a/SL/Controller/Warehouse.pm b/SL/Controller/Warehouse.pm index a7b059c89..3f8b1528a 100644 --- a/SL/Controller/Warehouse.pm +++ b/SL/Controller/Warehouse.pm @@ -15,14 +15,9 @@ __PACKAGE__->run_before('check_auth'); sub action_reorder { my ($self) = @_; - my @ids = @{ $::form->{warehouse_id} || [] }; - my $result = SL::DB::Warehouse->new->db->do_transaction(sub { - foreach my $idx (0 .. scalar(@ids) - 1) { - SL::DB::Warehouse->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1); - } - }); - - $self->render(type => 'js', inline => '1;'); + SL::DB::Warehouse->reorder_list(@{ $::form->{warehouse_id} || [] }); + + $self->render(\'', { type => 'json' }); } #