https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24528
David Nind <da...@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98065|0 |1 is obsolete| | --- Comment #8 from David Nind <da...@davidnind.com> --- Created attachment 98201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98201&action=edit Bug 24528: Add a syntax to x-koha-embed to specify counts This patch adds a + syntax to specify on the x-koha-embed header that we want the count of a relation in the response. For example: GET /patrons/1 x-koha-embed: checkouts+count Would return a JSON representation of a Koha::Patron, with a new attribute added: checkouts_count, which will be the result of calling $patron->checkouts->count. This is all done automatically in to_api. This patch makes parsing the x-koha-embed header build the right structure for passing to the to_api method. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/Koha/REST/Plugin/Query.t => SUCCESS: Tests pass! 3. Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: David Nind <da...@davidnind.com> Signed-off-by: David Nind <da...@davidnind.com> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://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/