This commit is contained in:
Kareila 2023-06-11 21:41:12 +00:00
parent 5e446bd2f8
commit ceff4547c8
6 changed files with 9 additions and 8 deletions

View File

@ -177,16 +177,17 @@ sub hash {
# Usage: get_one (user)
# Given a user, either return the first found key for them, or
# if they have no keys yet, generate one. Intended for use in
# situations where we have a logged in user and want to get a working API
# situations where we have a logged in user and want to get a working API
# key for them, without forcing them to jump through the menu hoops themselves.
sub get_one {
my ( $self, $u ) = @_;
my $apikeys = $self->get_keys_for_user($u);
my $key;
if (defined($apikeys->[0])) {
$key = $apikeys ->[0];
} else {
if ( defined( $apikeys->[0] ) ) {
$key = $apikeys->[0];
}
else {
$key = $self->new_for_user($u);
}
return $key;

View File

@ -310,7 +310,7 @@ sub action_handler {
my $items_html = render_items( $page, $view, $remote, $display_items, $expand );
my $folder_html = render_folders( $remote, $view );
return DW::RPC->out( success => {items => $items_html, folders => $folder_html} );
return DW::RPC->out( success => { items => $items_html, folders => $folder_html } );
}

View File

@ -48,7 +48,6 @@ sub _render_head {
};
}
sub should_render {
my ($self) = @_;

View File

@ -136,6 +136,7 @@ sub get_call_opts {
# APIs are versioned, so we only want to check for endpoints that match
# the version the user is requesting.
if ( $call_opts->role eq 'api' ) {
# return early if we weren't given an API version
return unless defined( $call_opts->apiver );

View File

@ -62,7 +62,7 @@ sub save {
# Check that the ID matches the format G-xxxxxxxxxx
# or is blank before proceeding.
if ( $txt =~ /^G-[A-Z0-9]{10,}$/i or $txt eq "" ) {
$u->ga4_analytics(uc $txt);
$u->ga4_analytics( uc $txt );
}
else {
$class->errors( "code" => $class->ml('setting.googleanalytics4.error.invalid') );

View File

@ -2879,7 +2879,7 @@ sub res_includes {
cmax_comment => LJ::CMAX_COMMENT,
);
my $site_params = to_json( \%site );
my $site_params = to_json( \%site );
# include standard JS info
$ret .= qq {