Bug 29234: Further clean Z3950 Tests
[koha-ffzg.git] / Koha / REST / V1 / AuthorisedValues.pm
index 39d1089..56ce327 100644 (file)
@@ -19,7 +19,6 @@ use Modern::Perl;
 
 use Mojo::Base 'Mojolicious::Controller';
 
-use Koha::AuthorisedValues;
 use Koha::AuthorisedValueCategories;
 
 use Try::Tiny;
@@ -28,7 +27,9 @@ use Try::Tiny;
 
 =head2 Methods
 
-=head3 list
+=head3 list_av_from_category
+
+This routine returns the authorised values for a given category
 
 =cut
 
@@ -47,7 +48,7 @@ sub list_av_from_category {
     }
 
     return try {
-        my $av_set = Koha::AuthorisedValues->search( { category => $category_name } )->search_with_library_limits;
+        my $av_set = $category->authorised_values->search_with_library_limits;
         my $avs    = $c->objects->search($av_set);
         return $c->render( status => 200, openapi => $avs );
     } catch {