|
Lines 227-249
sub update {
Link Here
|
| 227 |
my $params = $c->req->json; |
227 |
my $params = $c->req->json; |
| 228 |
$checkout->set_from_api( $params ); |
228 |
$checkout->set_from_api( $params ); |
| 229 |
$checkout->store(); |
229 |
$checkout->store(); |
|
|
230 |
$checkout->discard_changes; |
| 230 |
return $c->render( |
231 |
return $c->render( |
| 231 |
status => 200, |
232 |
status => 200, |
| 232 |
openapi => $checkout->to_api |
233 |
openapi => $checkout->to_api |
| 233 |
); |
234 |
); |
| 234 |
} |
235 |
} |
| 235 |
catch { |
236 |
catch { |
| 236 |
unless ( blessed $_ && $_->can('rethrow') ) { |
237 |
$c->unhandled_exception($_); |
| 237 |
return $c->render( |
|
|
| 238 |
status => 500, |
| 239 |
openapi => { error => "Something went wrong, check Koha logs for details." } |
| 240 |
); |
| 241 |
} |
| 242 |
|
| 243 |
return $c->render( |
| 244 |
status => 500, |
| 245 |
openapi => { error => "$_" } |
| 246 |
); |
| 247 |
}; |
238 |
}; |
| 248 |
} |
239 |
} |
| 249 |
|
240 |
|
| 250 |
- |
|
|