|
Lines 1-4
Link Here
|
| 1 |
package Koha::REST::V1::Illbackends; |
1 |
package Koha::REST::V1::ILL::Backends; |
| 2 |
|
2 |
|
| 3 |
# This file is part of Koha. |
3 |
# This file is part of Koha. |
| 4 |
# |
4 |
# |
|
Lines 21-31
use Mojo::Base 'Mojolicious::Controller';
Link Here
|
| 21 |
|
21 |
|
| 22 |
use Koha::Illrequest::Config; |
22 |
use Koha::Illrequest::Config; |
| 23 |
use Koha::Illrequests; |
23 |
use Koha::Illrequests; |
| 24 |
use Koha::Illbackend; |
24 |
use Koha::ILL::Backend; |
| 25 |
|
25 |
|
| 26 |
=head1 NAME |
26 |
=head1 NAME |
| 27 |
|
27 |
|
| 28 |
Koha::REST::V1::Illbackends |
28 |
Koha::REST::V1::ILL::Backends |
| 29 |
|
29 |
|
| 30 |
=head2 Operations |
30 |
=head2 Operations |
| 31 |
|
31 |
|
|
Lines 66-83
sub get {
Link Here
|
| 66 |
|
66 |
|
| 67 |
return try { |
67 |
return try { |
| 68 |
|
68 |
|
| 69 |
#FIXME: Should we move load_backend into Koha::Illbackend... |
69 |
#FIXME: Should we move load_backend into Koha::ILL::Backend... |
| 70 |
# or maybe make Koha::Ill::Backend a base class for all |
70 |
# or maybe make Koha::Ill::Backend a base class for all |
| 71 |
# backends? |
71 |
# backends? |
| 72 |
my $backend = Koha::Illrequest->new->load_backend($backend_id); |
72 |
my $backend = Koha::Illrequest->new->load_backend($backend_id); |
| 73 |
|
73 |
|
| 74 |
my $backend_module = Koha::Illbackend->new; |
74 |
my $backend_module = Koha::ILL::Backend->new; |
| 75 |
|
75 |
|
| 76 |
my $embed = |
76 |
my $embed = |
| 77 |
$backend_module->embed( $backend_id, |
77 |
$backend_module->embed( $backend_id, |
| 78 |
$c->req->headers->header('x-koha-embed') ); |
78 |
$c->req->headers->header('x-koha-embed') ); |
| 79 |
|
79 |
|
| 80 |
#TODO: We need a to_api method in Koha::Illbackend |
80 |
#TODO: We need a to_api method in Koha::ILL::Backend |
| 81 |
my $return = { |
81 |
my $return = { |
| 82 |
ill_backend_id => $backend_id, |
82 |
ill_backend_id => $backend_id, |
| 83 |
capabilities => $backend->capabilities, |
83 |
capabilities => $backend->capabilities, |