|
Lines 38-44
plugin 'Koha::REST::Plugin::Pagination';
Link Here
|
| 38 |
get '/cities' => sub { |
38 |
get '/cities' => sub { |
| 39 |
my $c = shift; |
39 |
my $c = shift; |
| 40 |
$c->validation->output($c->req->params->to_hash); |
40 |
$c->validation->output($c->req->params->to_hash); |
| 41 |
$c->stash_embed; |
41 |
$c->stash_embed( { spec => { parameters => [ { name => 'x-koha-embed', items => { enum => ['+strings'] } } ] } } ); |
| 42 |
my $cities = $c->objects->search(Koha::Cities->new); |
42 |
my $cities = $c->objects->search(Koha::Cities->new); |
| 43 |
$c->render( status => 200, json => $cities ); |
43 |
$c->render( status => 200, json => $cities ); |
| 44 |
}; |
44 |
}; |
|
Lines 55-61
get '/cities/rs' => sub {
Link Here
|
| 55 |
get '/cities/:city_id' => sub { |
55 |
get '/cities/:city_id' => sub { |
| 56 |
my $c = shift; |
56 |
my $c = shift; |
| 57 |
my $id = $c->stash("city_id"); |
57 |
my $id = $c->stash("city_id"); |
| 58 |
$c->stash_embed; |
58 |
$c->stash_embed( { spec => { parameters => [ { name => 'x-koha-embed', items => { enum => ['+strings'] } } ] } } ); |
| 59 |
my $city = $c->objects->find(Koha::Cities->new, $id); |
59 |
my $city = $c->objects->find(Koha::Cities->new, $id); |
| 60 |
$c->render( status => 200, json => $city ); |
60 |
$c->render( status => 200, json => $city ); |
| 61 |
}; |
61 |
}; |
| 62 |
- |
|
|