diff --git a/backend/src/services/ron/calendar.rs b/backend/src/services/ron/calendar.rs index 922128b..1f673c9 100644 --- a/backend/src/services/ron/calendar.rs +++ b/backend/src/services/ron/calendar.rs @@ -14,6 +14,8 @@ use crate::{ translation::Sentence, }; +use super::rights::*; + #[debug_handler] pub async fn get_scheduled_recipes( State(connection): State, @@ -51,6 +53,7 @@ pub async fn add_scheduled_recipe( Extension(context): Extension, ExtractRon(ron): ExtractRon, ) -> Result { + check_user_rights_recipe(&connection, &context.user, ron.recipe_id).await?; if let Some(user) = context.user { connection .add_scheduled_recipe( @@ -76,6 +79,7 @@ pub async fn rm_scheduled_recipe( Extension(context): Extension, ExtractRon(ron): ExtractRon, ) -> Result { + check_user_rights_recipe(&connection, &context.user, ron.recipe_id).await?; if let Some(user) = context.user { connection .rm_scheduled_recipe( diff --git a/frontend/src/calendar.rs b/frontend/src/calendar.rs index b2bd27c..dfb97d4 100644 --- a/frontend/src/calendar.rs +++ b/frontend/src/calendar.rs @@ -285,6 +285,8 @@ fn display_month( } }; + gloo::console::log!(nb_of_weeks); + for i in 0..6 { for j in 0..7 { let day_element: Element = by_id(&format!("day-grid-{}{}", i, j)); @@ -308,6 +310,7 @@ fn display_month( day_element.set_class_name(&classes.join(" ")); } else { + gloo::console::log!("ok"); day_element.set_class_name(""); day_content.set_inner_html(""); }