use Mojo::Base 'Mojolicious::Controller';
-use C4::Auth qw( haspermission );
use Koha::City;
use Koha::Cities;
}
return try {
- $cities = Koha::Cities->search($filter)->unblessed;
+ $cities = Koha::Cities->search($filter);
return $c->$cb( $cities, 200 );
}
catch {
return $c->$cb( { error => "City not found" }, 404 );
}
- return $c->$cb( $city->unblessed, 200 );
+ return $c->$cb( $city, 200 );
}
sub add {
return try {
$city->store;
- return $c->$cb( $city->unblessed, 200 );
+ return $c->$cb( $city, 200 );
}
catch {
if ( $_->isa('DBIx::Class::Exception') ) {
$city = Koha::Cities->find( $args->{cityid} );
$city->set( $args->{body} );
$city->store();
- return $c->$cb( $city->unblessed, 200 );
+ return $c->$cb( $city, 200 );
}
catch {
if ( not defined $city ) {