fixed some api and import stuff

This commit is contained in:
Finn 2019-07-09 13:50:26 +01:00
parent d0506c2a95
commit 1c942f0be7
No known key found for this signature in database
GPG key ID: 7455B4B17685B598
3 changed files with 11 additions and 1 deletions

View file

@ -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

View file

@ -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,
);

View file

@ -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);
}