]> git.ktnx.net Git - lsl.git/commitdiff
fix retrieval of shopping list items
authorDamyan Ivanov <dmn@debian.org>
Tue, 15 Feb 2022 21:12:53 +0000 (21:12 +0000)
committerDamyan Ivanov <dmn@debian.org>
Tue, 15 Feb 2022 21:12:53 +0000 (21:12 +0000)
lib/App/LazyShoppingList/API/v1.pm

index f94db2ea3d7aa4381723159345a4a618e160e671..cc8c1637057b2cbf0ae629dd7f8a3ca762f370cd 100644 (file)
@@ -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 =>