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

(-)a/Koha/REST/V1/Patrons/Attributes.pm (-5 / +2 lines)
Lines 205-217 sub overwrite { Link Here
205
                    openapi => { error => "$_" }
205
                    openapi => { error => "$_" }
206
                );
206
                );
207
            }
207
            }
208
            elsif ( $_->isa('Koha::Exceptions::Object::FKConstraint') ) {
208
            elsif ( $_->isa('Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute') ) {
209
                return $c->render(
209
                return $c->render(
210
                    status  => 400,
210
                    status  => 400,
211
                    openapi => {
211
                    openapi => { error => "$_" }
212
                        error => 'Missing mandatory attribute of type "'
213
                          . $_->value . '".'
214
                    }
215
                );
212
                );
216
213
217
            }
214
            }
(-)a/t/db_dependent/api/v1/patrons_extended_attributes.t (-2 / +1 lines)
Lines 301-307 subtest 'overwrite() tests' => sub { Link Here
301
          . '/extended_attributes' => json =>
301
          . '/extended_attributes' => json =>
302
          [ { type => $unique_attr_type->code, value => $value_1 } ] )
302
          [ { type => $unique_attr_type->code, value => $value_1 } ] )
303
      ->status_is(400)
303
      ->status_is(400)
304
      ->json_is( '/error' => 'Missing mandatory attribute of type "' . $mandatory_attr_type->code . '".' );
304
      ->json_is( '/error' => "Missing mandatory extended attribute (type=" . $mandatory_attr_type->code . ')' );
305
305
306
    $patron->add_extended_attribute({ code => $repeatable_attr_type->code, attribute => 'repeatable_1' });
306
    $patron->add_extended_attribute({ code => $repeatable_attr_type->code, attribute => 'repeatable_1' });
307
    $patron->add_extended_attribute({ code => $repeatable_attr_type->code, attribute => 'repeatable_2' });
307
    $patron->add_extended_attribute({ code => $repeatable_attr_type->code, attribute => 'repeatable_2' });
308
- 

Return to bug 23666