From: Damyan Ivanov Date: Tue, 15 Feb 2022 21:12:53 +0000 (+0000) Subject: fix retrieval of shopping list items X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=88805af2232addca6362effda7141a9e634b10be;p=lsl.git fix retrieval of shopping list items --- diff --git a/lib/App/LazyShoppingList/API/v1.pm b/lib/App/LazyShoppingList/API/v1.pm index f94db2e..cc8c163 100644 --- a/lib/App/LazyShoppingList/API/v1.pm +++ b/lib/App/LazyShoppingList/API/v1.pm @@ -88,8 +88,10 @@ get '/list/:list_id' => sub { $r{version} = $list->version; - my @items = $dbh->resultset('ShoppingListItem') - ->search( undef, { order_by => { -asc => 'id' } } )->all; + my @items = $dbh->resultset('ShoppingListItem')->search( + { shopping_list => $list->id }, + { order_by => { -asc => 'id' } } + )->all; for my $item (@items) { push @{ $r{items} }, { uri =>