Skip to content

Commit

Permalink
(#491) Fix UTF8 character encoding in /api/database/backup and /api/d…
Browse files Browse the repository at this point in the history
…atabase/stats
  • Loading branch information
Difegue committed Aug 1, 2021
1 parent 48f493e commit 703ce9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/LANraragi/Controller/Api/Database.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package LANraragi::Controller::Api::Database;
use Mojo::Base 'Mojolicious::Controller';

use Redis;
use Mojo::JSON qw(from_json);
use Mojo::JSON qw(decode_json);

use LANraragi::Model::Backup;
use LANraragi::Model::Stats;
Expand All @@ -11,7 +11,7 @@ use LANraragi::Utils::Database qw(invalidate_cache);

sub serve_backup {
my $self = shift;
$self->render( json => from_json(LANraragi::Model::Backup::build_backup_JSON) );
$self->render( json => decode_json(LANraragi::Model::Backup::build_backup_JSON) );
}

sub drop_database {
Expand All @@ -21,7 +21,7 @@ sub drop_database {

sub serve_tag_stats {
my $self = shift;
$self->render( json => from_json(LANraragi::Model::Stats::build_tag_json) );
$self->render( json => decode_json(LANraragi::Model::Stats::build_tag_json) );
}

sub clean_database {
Expand Down

0 comments on commit 703ce9e

Please sign in to comment.