- //let recipes = connection.set_recipe_title_async(id, title).await?;
-
- Ok(
- HttpResponse::Ok()
- .content_type("application/ron")
- .body("DATA")
- )
+#[put("/ron-api/recipe/set-description")]
+pub async fn set_recipe_description(req: HttpRequest, body: web::Bytes, connection: web::Data<db::Connection>) -> Result<HttpResponse> {
+ let ron_req: common::ron_api::SetRecipeDescription = from_bytes(&body)?;
+ connection.set_recipe_description_async(ron_req.recipe_id, &ron_req.description).await?;
+ Ok(HttpResponse::Ok().finish())