From: Damyan Ivanov Date: Thu, 10 Feb 2022 20:50:17 +0000 (+0000) Subject: no need to decode input data, the serializar does it X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=4dd9097db8745aa206ab6d3416ecb665a45ea8f4;p=lsl.git no need to decode input data, the serializar does it --- diff --git a/lib/App/LazyShoppingList/API/v1.pm b/lib/App/LazyShoppingList/API/v1.pm index 6e1cd31..46995e8 100644 --- a/lib/App/LazyShoppingList/API/v1.pm +++ b/lib/App/LazyShoppingList/API/v1.pm @@ -43,7 +43,7 @@ get '/list' => sub { # create shopping list post '/list' => sub { - my $req = decode_json(request_data); + my $req = request_data; my $name = $req->{name}; unless ($name) { @@ -116,7 +116,7 @@ post '/list/:id' => sub { length($list_id) and $list_id =~ /^\d{1,18}$/ or return invalid_input('bad list ID'); - my $req = decode_json(request_data); + my $req = request_data; my $descr = $req->{description}; my $done = JSON->boolean( $req->{done} // 0 ); @@ -166,7 +166,7 @@ put '/list/:list_id/:item_id' => sub { length($item_id) and $item_id =~ /^\d{1,18}$/ or return invalid_input('bad item ID'); - my $req = decode_json(request_data); + my $req = request_data; my $descr = $req->{description}; my $done = JSON->boolean( $req->{done} // 0 );