Reformat Controller perl code using perltidy

This commit is contained in:
2025-01-14 12:49:31 +00:00
parent 7ff51625c0
commit c1915a722b
38 changed files with 5870 additions and 7437 deletions

View File

@@ -1,56 +1,46 @@
package SrvMngr::Controller::Request;
#
# routes : end
#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
# retrieve a configuration db record
sub getconfig {
my $c = shift;
my $c = shift;
my $key = $c->param('key');
$c->app->log->info($c->log_req . ' ' . $key);
if ($key) {
use esmith::ConfigDB qw(open_ro);
my $cdb = esmith::ConfigDB->open_ro;
return getdb( $c, $cdb, $key);
}
}
use esmith::ConfigDB qw(open_ro);
my $cdb = esmith::ConfigDB->open_ro;
return getdb($c, $cdb, $key);
} ## end if ($key)
} ## end sub getconfig
# retrieve an accounts db record, given its name
sub getaccount {
my $c = shift;
my $c = shift;
my $key = $c->param('key');
$c->app->log->info($c->log_req . ' ' . $key);
if ($key) {
use esmith::AccountsDB qw(open_ro);
my $adb = esmith::AccountsDB->open_ro;
return getdb( $c, $adb, $key);
}
}
use esmith::AccountsDB qw(open_ro);
my $adb = esmith::AccountsDB->open_ro;
return getdb($c, $adb, $key);
} ## end if ($key)
} ## end sub getaccount
sub getdb {
my ($c, $db, $key) = @_;
if ( my $rec = $db->get($key) ) {
return $c->render(json => { $key => { $rec->props }} );
if (my $rec = $db->get($key)) {
return $c->render(json => { $key => { $rec->props } });
}
return undef;
}
} ## end sub getdb
1;