https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19234
Lari Taskula <lari.task...@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67375|0 |1 is obsolete| | --- Comment #25 from Lari Taskula <lari.task...@jns.fi> --- Created attachment 67786 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67786&action=edit Bug 19234: Add query parameters handling helpers This patch introduces a Mojolicious plugin to be used on the REST api. It adds a helper method: generate_dbic_query =================== When used, it generates what's needed to perform a search on DBIC/Koha::Objects like this: my $params = $c->validation->output; my ($filtered_params, $reserved_params) = $c->extract_reserved_params($params); my $filter = do_smth($filtered_params, $reserved_params); my $attributes = do_smth_reserved($reserved_params); my $patrons = Koha::Patrons->search( $filter, $attributes ); It introduces reserved param names: - _match - _order_by - _page - _per_page They are reserved for later usage (pagination, matching algorithm on building DB queries) All the plugin's behaviour is tested. To test: - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/Koha/REST/Plugin/Query.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater solutions Sponsored-by: Camden County Signed-off-by: Kyle M Hall <k...@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Signed-off-by: Kyle M Hall <k...@bywatersolutions.com> Signed-off-by: Lari Taskula <lari.task...@jns.fi> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/