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

(-)a/Koha/REST/V1/Patron.pm (-2 / +2 lines)
Lines 28-34 sub list { Link Here
28
28
29
    my $patrons = Koha::Patrons->search;
29
    my $patrons = Koha::Patrons->search;
30
30
31
    $c->$cb($patrons->unblessed, 200);
31
    $c->$cb($patrons, 200);
32
}
32
}
33
33
34
sub get {
34
sub get {
Lines 41-47 sub get { Link Here
41
        return $c->$cb({error => "Patron not found"}, 404);
41
        return $c->$cb({error => "Patron not found"}, 404);
42
    }
42
    }
43
43
44
    return $c->$cb($patron->unblessed, 200);
44
    return $c->$cb($patron, 200);
45
}
45
}
46
46
47
1;
47
1;
(-)a/Koha/Schema/Result/Borrower.pm (+5 lines)
Lines 1343-1348 __PACKAGE__->belongs_to( Link Here
1343
    { borrowernumber => "guarantorid" },
1343
    { borrowernumber => "guarantorid" },
1344
);
1344
);
1345
1345
1346
__PACKAGE__->add_columns(
1347
    '+lost' => { is_boolean => 1 },
1348
    '+gonenoaddress' => { is_boolean => 1 }
1349
);
1350
1346
sub koha_objects_class {
1351
sub koha_objects_class {
1347
    'Koha::Patrons';
1352
    'Koha::Patrons';
1348
}
1353
}
(-)a/t/db_dependent/api/v1/patrons.t (-4 / +5 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 20;
20
use Test::More tests => 21;
21
use Test::Mojo;
21
use Test::Mojo;
22
use t::lib::TestBuilder;
22
use t::lib::TestBuilder;
23
23
Lines 52-58 my $borrower = $builder->build({ Link Here
52
        branchcode   => $branchcode,
52
        branchcode   => $branchcode,
53
        categorycode => $categorycode,
53
        categorycode => $categorycode,
54
        flags        => 0,
54
        flags        => 0,
55
        guarantorid    => $guarantor->{borrowernumber},
55
        lost         => 1,
56
        guarantorid  => $guarantor->{borrowernumber},
56
    }
57
    }
57
});
58
});
58
59
Lines 127-132 $tx->req->cookies({name => 'CGISESSID', value => $session->id}); Link Here
127
$t->request_ok($tx)
128
$t->request_ok($tx)
128
  ->status_is(200)
129
  ->status_is(200)
129
  ->json_is('/borrowernumber' => $borrower->{ borrowernumber })
130
  ->json_is('/borrowernumber' => $borrower->{ borrowernumber })
130
  ->json_is('/surname' => $borrower->{ surname });
131
  ->json_is('/surname' => $borrower->{ surname })
132
  ->json_is('/lost' => 1 );
131
133
132
$dbh->rollback;
134
$dbh->rollback;
133
- 

Return to bug 17932