Beginning of frontend + recipe editing
[recipes.git] / backend / src / data / asynchronous.rs
index a5a5cdf..186dad6 100644 (file)
@@ -112,4 +112,10 @@ impl Connection {
         let title_copy = title.to_string();
         combine_errors(web::block(move || { self_copy.set_recipe_title(recipe_id, &title_copy).map_err(DBAsyncError::from) }).await)
     }
+
+    pub async fn set_recipe_description_async(&self, recipe_id: i64, description: &str) -> Result<()> {
+        let self_copy = self.clone();
+        let description_copy = description.to_string();
+        combine_errors(web::block(move || { self_copy.set_recipe_description(recipe_id, &description_copy).map_err(DBAsyncError::from) }).await)
+    }
 }
\ No newline at end of file