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

(-)a/Koha/REST/V1/Bookings.pm (+2 lines)
Lines 77-82 sub add { Link Here
77
    return try {
77
    return try {
78
        my $booking = Koha::Booking->new_from_api( $c->req->json );
78
        my $booking = Koha::Booking->new_from_api( $c->req->json );
79
        $booking->store;
79
        $booking->store;
80
        $booking->discard_changes;
80
        $c->res->headers->location( $c->req->url->to_string . '/' . $booking->booking_id );
81
        $c->res->headers->location( $c->req->url->to_string . '/' . $booking->booking_id );
81
        return $c->render(
82
        return $c->render(
82
            status  => 201,
83
            status  => 201,
Lines 118-123 sub update { Link Here
118
    return try {
119
    return try {
119
        $booking->set_from_api( $c->req->json );
120
        $booking->set_from_api( $c->req->json );
120
        $booking->store();
121
        $booking->store();
122
        $booking->discard_changes;
121
        return $c->render( status => 200, openapi => $c->objects->to_api($booking) );
123
        return $c->render( status => 200, openapi => $c->objects->to_api($booking) );
122
    } catch {
124
    } catch {
123
        $c->unhandled_exception($_);
125
        $c->unhandled_exception($_);
(-)a/api/v1/swagger/definitions/booking.yaml (-1 / +2 lines)
Lines 12-17 properties: Link Here
12
    type: integer
12
    type: integer
13
  creation_date:
13
  creation_date:
14
    description: Creation date and time of this booking
14
    description: Creation date and time of this booking
15
    readOnly: true
15
    format: date-time
16
    format: date-time
16
    type: string
17
    type: string
17
  end_date:
18
  end_date:
Lines 30-35 properties: Link Here
30
      - 'null'
31
      - 'null'
31
  modification_date:
32
  modification_date:
32
    description: Modification date and time of this booking
33
    description: Modification date and time of this booking
34
    readOnly: true
33
    format: date-time
35
    format: date-time
34
    type: string
36
    type: string
35
  patron_id:
37
  patron_id:
36
- 

Return to bug 37592