From 88805af2232addca6362effda7141a9e634b10be Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 15 Feb 2022 21:12:53 +0000 Subject: [PATCH] fix retrieval of shopping list items --- lib/App/LazyShoppingList/API/v1.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 => -- 2.39.5