Shopping list items can now be checked/unchecked

This commit is contained in:
Greg Burri 2025-02-12 23:13:48 +01:00
parent 3a3288bc93
commit a1fd63ad08
14 changed files with 940 additions and 790 deletions

View file

@ -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)
}
}
}