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

(-)a/Koha/REST/V1/Biblios.pm (+6 lines)
Lines 370-375 sub add_item { Link Here
370
370
371
        $item->store->discard_changes;
371
        $item->store->discard_changes;
372
372
373
        my $base_url = $c->req->url->to_string;
374
        $base_url =~ s|/biblios/\d+||;
375
        $c->res->headers->location( $base_url . '/' . $item->id );
376
373
        $c->render(
377
        $c->render(
374
            status  => 201,
378
            status  => 201,
375
            openapi => $c->objects->to_api($item),
379
            openapi => $c->objects->to_api($item),
Lines 719-724 sub add { Link Here
719
            );
723
            );
720
        }
724
        }
721
725
726
        $c->res->headers->location( $c->req->url->to_string . '/' . $biblio_id );
727
722
        return $c->render(
728
        return $c->render(
723
            status  => 200,
729
            status  => 200,
724
            openapi => { id => $biblio_id }
730
            openapi => { id => $biblio_id }
(-)a/Koha/REST/V1/Clubs/Holds.pm (+2 lines)
Lines 108-113 sub add { Link Here
108
            }
108
            }
109
        );
109
        );
110
110
111
        $c->res->headers->location( $c->req->url->to_string . '/' . $club_hold->id );
112
111
        return $c->render(
113
        return $c->render(
112
            status  => 201,
114
            status  => 201,
113
            openapi => $c->objects->to_api($club_hold),
115
            openapi => $c->objects->to_api($club_hold),
(-)a/Koha/REST/V1/Holds.pm (+2 lines)
Lines 216-221 sub add { Link Here
216
216
217
        my $hold = Koha::Holds->find($hold_id);
217
        my $hold = Koha::Holds->find($hold_id);
218
218
219
        $c->res->headers->location( $c->req->url->to_string . '/' . $hold_id );
220
219
        return $c->render(
221
        return $c->render(
220
            status  => 201,
222
            status  => 201,
221
            openapi => $c->objects->to_api($hold),
223
            openapi => $c->objects->to_api($hold),
(-)a/Koha/REST/V1/ILL/Batch/Statuses.pm (+1 lines)
Lines 84-89 sub add { Link Here
84
                openapi => $return
84
                openapi => $return
85
            );
85
            );
86
        } else {
86
        } else {
87
            $c->res->headers->location( $c->req->url->to_string . '/' . $status->code );
87
            return $c->render(
88
            return $c->render(
88
                status  => 201,
89
                status  => 201,
89
                openapi => $status
90
                openapi => $status
(-)a/Koha/REST/V1/ImportBatchProfiles.pm (+1 lines)
Lines 68-73 sub add { Link Here
68
68
69
    return try {
69
    return try {
70
        my $profile = Koha::ImportBatchProfile->new_from_api( $body )->store;
70
        my $profile = Koha::ImportBatchProfile->new_from_api( $body )->store;
71
        $c->res->headers->location( $c->req->url->to_string . '/' . $profile->id );
71
        return $c->render(
72
        return $c->render(
72
            status  => 201,
73
            status  => 201,
73
            openapi => $c->objects->to_api($profile),
74
            openapi => $c->objects->to_api($profile),
(-)a/Koha/REST/V1/TransferLimits.pm (-1 / +2 lines)
Lines 74-79 sub add { Link Here
74
            Koha::Exceptions::TransferLimit::Duplicate->throw();
74
            Koha::Exceptions::TransferLimit::Duplicate->throw();
75
        }
75
        }
76
76
77
        $c->res->headers->location( $c->req->url->to_string . '/' . $transfer_limit->id );
78
77
        return $c->render(
79
        return $c->render(
78
            status  => 201,
80
            status  => 201,
79
            openapi => $c->objects->to_api($transfer_limit),
81
            openapi => $c->objects->to_api($transfer_limit),
80
- 

Return to bug 38929