Fix import ref

This commit is contained in:
Tom Bloor 2019-07-15 12:36:28 +01:00
parent b1ab789455
commit 0328bdc1f6
No known key found for this signature in database
GPG key ID: 4657C7EBE42CC5CC

View file

@ -17,14 +17,12 @@ sub post_lcc_transactions {
return $c->api_validation_error if $validation->has_error; return $c->api_validation_error if $validation->has_error;
my $search_ref = undef; my $search_ref = { 'me.buyer_id' => $user->entity->id };
if ( $validation->param('search') ) { if ($validation->param('search')) {
$search_ref = { $search_ref->{"organisation.name"} = { '-like' => join('', '%', $validation->param('search'), '%') };
"organisation.name" => { '-like' => join( '', '%', $validation->param('search'), '%' ) },
};
} }
my $lcc_transactions = $lcc_import_ext_ref->transactions->search( my $lcc_transactions = $c->schema->resultset('Transaction')->search(
$search_ref, $search_ref,
{ {
page => $validation->param('page') || 1, page => $validation->param('page') || 1,