View | Details | Raw Unified | Return to bug 17314
Collapse All | Expand All

(-)a/Koha/REST/V1/Suggestions.pm (-2 / +4 lines)
Lines 29-34 use Koha::Suggestions; Link Here
29
use Koha::ItemTypes;
29
use Koha::ItemTypes;
30
use Koha::Libraries;
30
use Koha::Libraries;
31
31
32
use List::MoreUtils qw/any/;
33
32
use Try::Tiny;
34
use Try::Tiny;
33
35
34
sub list {
36
sub list {
Lines 175-182 sub _validate_body { Link Here
175
        }
177
        }
176
178
177
        foreach my $param ( keys %{ $body } ) {
179
        foreach my $param ( keys %{ $body } ) {
178
            unless (/^$param$/ ~~ @allowed_fields) {
180
            unless (any { /^$param$/ } @allowed_fields) {
179
                # Ouch ! Some mandatory field is missing!
181
                # Ouch ! User trying to edit field he has no rights to edit!
180
                my $verb = $updating ? 'updated ' : 'specified ';
182
                my $verb = $updating ? 'updated ' : 'specified ';
181
                return $c->$cb({error => 'You ' . $verb . $param . ', but allowed fields are only ' .
183
                return $c->$cb({error => 'You ' . $verb . $param . ', but allowed fields are only ' .
182
                        join(', ', @allowed_fields)}, 403);
184
                        join(', ', @allowed_fields)}, 403);
(-)a/api/v1/swagger/definitions/suggestion.json (-3 / +2 lines)
Lines 10-16 Link Here
10
      "description": "borrowernumber for the person making the suggestion, foreign key linking to the borrowers table"
10
      "description": "borrowernumber for the person making the suggestion, foreign key linking to the borrowers table"
11
    },
11
    },
12
    "suggesteddate": {
12
    "suggesteddate": {
13
      "type": "string",
13
      "type": ["string", "null"],
14
      "description": "the suggestion was submitted"
14
      "description": "the suggestion was submitted"
15
    },
15
    },
16
    "managedby": {
16
    "managedby": {
Lines 70-76 Link Here
70
      "description": "volume description"
70
      "description": "volume description"
71
    },
71
    },
72
    "publicationyear": {
72
    "publicationyear": {
73
      "type": "string",
73
      "type": ["string", "null"],
74
      "description": "year of publication"
74
      "description": "year of publication"
75
    },
75
    },
76
    "place": {
76
    "place": {
77
- 

Return to bug 17314