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

(-)a/Koha/REST/V1/Acquisitions/Baskets.pm (-4 / +3 lines)
Lines 43-56 sub add { Link Here
43
    my $c = shift->openapi->valid_input or return;
43
    my $c = shift->openapi->valid_input or return;
44
44
45
    return try {
45
    return try {
46
        my $basket = Koha::Acquisition::Basket->new_from_api( $c->validation->param('body') );
46
        my $basket = Koha::Acquisition::Basket->new_from_api( $c->req->json );
47
        $basket->store->discard_changes;
47
        $basket->store;
48
48
49
        $c->res->headers->location( $c->req->url->to_string . '/' . $basket->basketno );
49
        $c->res->headers->location( $c->req->url->to_string . '/' . $basket->basketno );
50
50
51
        return $c->render(
51
        return $c->render(
52
            status  => 201,
52
            status  => 201,
53
            openapi => $basket->to_api
53
            openapi => $c->objects->to_api($basket),
54
        );
54
        );
55
    } catch {
55
    } catch {
56
        $c->unhandled_exception($_);
56
        $c->unhandled_exception($_);
57
- 

Return to bug 29668