From 4dd9097db8745aa206ab6d3416ecb665a45ea8f4 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 10 Feb 2022 20:50:17 +0000 Subject: [PATCH] no need to decode input data, the serializar does it --- lib/App/LazyShoppingList/API/v1.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ); -- 2.39.5