Doc + formatting

This commit is contained in:
Greg Burri 2025-03-18 20:03:25 +01:00
parent 9ed5a04e22
commit 995f77d1ef
9 changed files with 39 additions and 30 deletions

View file

@ -1,6 +1,6 @@
use std::{cell::RefCell, rc::Rc};
use chrono::{offset::Local, Datelike, Days, Months, NaiveDate, Weekday};
use chrono::{Datelike, Days, Months, NaiveDate, Weekday, offset::Local};
use common::{ron_api, utils::substitute_with_names};
use gloo::{
console::log,
@ -16,7 +16,7 @@ use crate::{
modal_dialog,
recipe_scheduler::RecipeScheduler,
request,
utils::{by_id, get_locale, selector, selector_all, SelectorExt},
utils::{SelectorExt, by_id, get_locale, selector, selector_all},
};
struct CalendarStateInternal {
@ -116,7 +116,7 @@ pub fn setup(
EventListener::new(&days, "click", move |event| {
let target: Element = event.target().unwrap().dyn_into().unwrap();
log!(event);
// log!(event); // TODO: Remove.
if target.class_name() == "number" && options.can_select_date {
let first_day = first_grid_day(state_clone.get_displayed_date());

View file

@ -61,6 +61,9 @@ pub fn setup_page(is_user_logged: bool) {
}
EventListener::new(
// TODO: Find the right place to move the item based on:
// 1) recipe id, 2) name, 3) shopping entry id
// Se shopping_list.rs@L30
&item_element.selector(".item-is-checked"),
"change",
move |event| {

View file

@ -1,7 +1,7 @@
use chrono::{Datelike, Days, Months, NaiveDate};
use common::ron_api;
use gloo::storage::{LocalStorage, Storage};
use ron::ser::{to_string_pretty, PrettyConfig};
use ron::ser::{PrettyConfig, to_string_pretty};
use serde::{Deserialize, Serialize};
use thiserror::Error;
@ -37,7 +37,7 @@ impl ShoppingList {
if self.is_local {
todo!();
} else {
request::put(
request::patch(
"shopping_list/set_checked",
ron_api::Value {
id: item_id,