the idea is that an app would want to have the name early in order to be
able to display the list of available shopping lists, and later, after
the user selects a shopping list, it would retrieve the items
also, it makes more sense this way since the lists_version thing is a
property of the list of shopping lists and is changed upon a list rename
Returns a JSON object with the following keys:
Returns a JSON object with the following keys:
- - `lists`: a list of shopping list URIs. Referred to as `/list/$list_id`
- below.
+ - `lists`: a list of objects with the following keys:
+ - `uri`: tjhe list URIs. Referred to as `/list/$list_id` below.
+ - `name`: list name as entered by users
- `lists_version`: a number that is incremented by 1 each time the list of
shopping lists changes. Changes include adding, removing and renaming a
shopping list, but not changes to individual shopping list items.
- `lists_version`: a number that is incremented by 1 each time the list of
shopping lists changes. Changes include adding, removing and renaming a
shopping list, but not changes to individual shopping list items.
Returns a JSON object with the following keys:
Returns a JSON object with the following keys:
- - `name`: list name, as entered by users
- `items`: a list of shopping list item objects with keys:
- `uri`: the URI of the individual list item
- `description`: item description
- `items`: a list of shopping list item objects with keys:
- `uri`: the URI of the individual list item
- `description`: item description
{ order_by => { -asc => 'name' } } )->all
)
{
{ order_by => { -asc => 'name' } } )->all
)
{
- push @{ $r{lists} }, uri_for( "/list/" . $list->id );
+ push @{ $r{lists} },
+ { uri => uri_for( "/list/" . $list->id ), name => $list->name };