Lines 34-40
use Try::Tiny qw( catch try );
Link Here
|
34 |
=cut |
34 |
=cut |
35 |
|
35 |
|
36 |
sub list { |
36 |
sub list { |
37 |
my $c = shift->openapi->valid_input or return; |
37 |
my $c = shift or return; |
38 |
|
38 |
|
39 |
return try { |
39 |
return try { |
40 |
my $titles_set = Koha::ERM::EHoldings::Titles->new; |
40 |
my $titles_set = Koha::ERM::EHoldings::Titles->new; |
Lines 54-60
Controller function that handles retrieving a single Koha::ERM::EHoldings::Title
Link Here
|
54 |
=cut |
54 |
=cut |
55 |
|
55 |
|
56 |
sub get { |
56 |
sub get { |
57 |
my $c = shift->openapi->valid_input or return; |
57 |
my $c = shift or return; |
58 |
|
58 |
|
59 |
return try { |
59 |
return try { |
60 |
my $title_id = $c->validation->param('title_id'); |
60 |
my $title_id = $c->validation->param('title_id'); |
Lines 84-90
Controller function that handles adding a new Koha::ERM::EHoldings::Title object
Link Here
|
84 |
=cut |
84 |
=cut |
85 |
|
85 |
|
86 |
sub add { |
86 |
sub add { |
87 |
my $c = shift->openapi->valid_input or return; |
87 |
my $c = shift or return; |
88 |
|
88 |
|
89 |
return try { |
89 |
return try { |
90 |
Koha::Database->new->schema->txn_do( |
90 |
Koha::Database->new->schema->txn_do( |
Lines 150-156
Controller function that handles updating a Koha::ERM::EHoldings::Title object
Link Here
|
150 |
=cut |
150 |
=cut |
151 |
|
151 |
|
152 |
sub update { |
152 |
sub update { |
153 |
my $c = shift->openapi->valid_input or return; |
153 |
my $c = shift or return; |
154 |
|
154 |
|
155 |
my $title_id = $c->validation->param('title_id'); |
155 |
my $title_id = $c->validation->param('title_id'); |
156 |
my $title = Koha::ERM::EHoldings::Titles->find( $title_id ); |
156 |
my $title = Koha::ERM::EHoldings::Titles->find( $title_id ); |
Lines 217-223
sub update {
Link Here
|
217 |
=cut |
217 |
=cut |
218 |
|
218 |
|
219 |
sub delete { |
219 |
sub delete { |
220 |
my $c = shift->openapi->valid_input or return; |
220 |
my $c = shift or return; |
221 |
|
221 |
|
222 |
my $title = Koha::ERM::EHoldings::Titles->find( $c->validation->param('title_id') ); |
222 |
my $title = Koha::ERM::EHoldings::Titles->find( $c->validation->param('title_id') ); |
223 |
unless ($title) { |
223 |
unless ($title) { |
Lines 244-250
sub delete {
Link Here
|
244 |
=cut |
244 |
=cut |
245 |
|
245 |
|
246 |
sub import_from_list { |
246 |
sub import_from_list { |
247 |
my $c = shift->openapi->valid_input or return; |
247 |
my $c = shift or return; |
248 |
|
248 |
|
249 |
my $body = $c->validation->param('body'); |
249 |
my $body = $c->validation->param('body'); |
250 |
my $list_id = $body->{list_id}; |
250 |
my $list_id = $body->{list_id}; |
251 |
- |
|
|