From 08d96687d7d4b32f34c58d21d8621b3ad6a93e76 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 6 Mar 2022 11:33:08 +0000 Subject: [PATCH] version is mandatory when updating a list --- lib/App/LazyShoppingList/API/v1.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/App/LazyShoppingList/API/v1.pm b/lib/App/LazyShoppingList/API/v1.pm index 185c094..f65fd42 100644 --- a/lib/App/LazyShoppingList/API/v1.pm +++ b/lib/App/LazyShoppingList/API/v1.pm @@ -222,8 +222,8 @@ put '/list/:list_id' => sub { my $req = request_data; - my $name = $req->{name} // ''; - my $version = $req->{version} // -1; + my $name = $req->{name} // ''; + my $version = $req->{version}; length($version) and $version =~ /^\d{1,18}$/ or return invalid_input('bad version'); -- 2.39.5