From: Damyan Ivanov Date: Sun, 6 Mar 2022 11:32:44 +0000 (+0000) Subject: fix updating only done state or only item descriptiom X-Git-Url: https://git.ktnx.net/?p=lsl.git;a=commitdiff_plain;h=49cfcc1d4523f5882f585c19a6afebb58e01ec02 fix updating only done state or only item descriptiom --- diff --git a/lib/App/LazyShoppingList/API/v1.pm b/lib/App/LazyShoppingList/API/v1.pm index c13137a..185c094 100644 --- a/lib/App/LazyShoppingList/API/v1.pm +++ b/lib/App/LazyShoppingList/API/v1.pm @@ -166,7 +166,8 @@ put '/list/:list_id/:item_id' => sub { my $req = request_data; my $descr = $req->{description}; - my $done = JSON->boolean( $req->{done} // 0 ); + my $done = + exists $req->{done} ? JSON->boolean( $req->{done} // 0 ) : undef; my $version = $req->{version}; length($version) and $version =~ /^\d{1,18}$/