[Koha-bugs] [Bug 16330] REST API: add routes to add, update and delete patrons

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Aug 29 11:34:58 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16330

--- Comment #27 from Benjamin Rokseth <benjamin.rokseth at kul.oslo.kommune.no> ---
(In reply to Jonathan Druart from comment #22)
> Comment on attachment 54942 [details] [review]
> Bug 16330: REST API: add routes to add, update and delete patrons
> 
> Review of attachment 54942 [details] [review]:
> -----------------------------------------------------------------
> 
> ::: Koha/REST/V1/Patron.pm
> @@ +31,5 @@
> > +    my $patrons;
> > +    if (keys %$params) {
> > +        my @valid_params = Koha::Patrons->columns;
> > +        foreach my $key (keys %$params) {
> > +            delete $params->{$key} unless grep { $key eq $_ } @valid_params;
> 
> Should not we raise an error instead of removing invalid params?

Absolutely right! Actually, it might be better to use formData and let swagger
definitions do the validation.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list