From 49cfcc1d4523f5882f585c19a6afebb58e01ec02 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 6 Mar 2022 11:32:44 +0000 Subject: [PATCH] fix updating only done state or only item descriptiom --- lib/App/LazyShoppingList/API/v1.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}$/ -- 2.39.5