Shopping list items can now be checked/unchecked
This commit is contained in:
parent
3a3288bc93
commit
a1fd63ad08
14 changed files with 940 additions and 790 deletions
|
|
@ -32,4 +32,20 @@ impl ShoppingList {
|
|||
Ok(request::get("shopping_list/get_list", ()).await?)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn set_item_checked(&self, item_id: i64, is_checked: bool) -> Result<()> {
|
||||
if self.is_local {
|
||||
todo!();
|
||||
} else {
|
||||
request::put(
|
||||
"shopping_list/set_checked",
|
||||
ron_api::Value {
|
||||
id: item_id,
|
||||
value: is_checked,
|
||||
},
|
||||
)
|
||||
.await
|
||||
.map_err(Error::from)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue