diff --git a/CHANGELOG.md b/CHANGELOG.md index 1490668..0863a9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # Next Release +* Added proper minion job support +* **Admin Feature** Added importing of CSVs from Lancaster City Council +* Added pagination support to searching of organisations during transaction submission in API + # v0.10.9 * Removed sector list from dashboard stats and swapped it for category list diff --git a/lib/Pear/LocalLoop/Controller/Api/Upload.pm b/lib/Pear/LocalLoop/Controller/Api/Upload.pm index c638645..2bcd161 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Upload.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Upload.pm @@ -265,6 +265,7 @@ sub post_search { $validation->input( $c->stash->{api_json} ); $validation->required('search_name'); + $validation->optional('page')->number; return $c->api_validation_error if $validation->has_error; @@ -276,6 +277,11 @@ sub post_search { my $valid_orgs_rs = $org_rs->search({ pending => 0, entity_id => { "!=" => $user->entity_id }, + }, + { + page => $validation->param('page') || 1, + rows => 10, + order_by => { -desc => 'name' }, })->search( \$search_stmt, ); diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm index 77d7e92..a143af4 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm @@ -19,7 +19,7 @@ sub import_csv { my ($self) = @_; my $rows = $self->csv_data; - + my $lcc_org = $self->schema->resultset('Organisation')->find({ name => "Lancashire County Council" }); foreach my $row ( @{$rows} ) { $self->_row_to_result($row); }