feat: ability to manage sub recipes in desktop ui (#6360)

Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
Signed-off-by: Abhijay Jain <Abhijay007j@gmail.com>
This commit is contained in:
Abhijay Jain
2026-03-23 21:04:58 +05:30
committed by GitHub
parent 59c74e1b7d
commit 79f539f8af
15 changed files with 1079 additions and 16 deletions
+14 -3
View File
@@ -103,6 +103,8 @@ pub struct SaveRecipeRequest {
#[derive(Debug, Serialize, ToSchema)]
pub struct SaveRecipeResponse {
id: String,
file_name: String,
file_path: String,
}
#[derive(Debug, Deserialize, ToSchema)]
pub struct ParseRecipeRequest {
@@ -459,9 +461,18 @@ async fn save_recipe(
};
match local_recipes::save_recipe_to_file(request.recipe, file_path.clone()) {
Ok(save_file_path) => Ok(Json(SaveRecipeResponse {
id: short_id_from_path(&save_file_path.display().to_string()),
})),
Ok(save_file_path) => {
let file_name = save_file_path
.file_name()
.map(|n| n.to_string_lossy().to_string())
.unwrap_or_default();
let file_path_str = save_file_path.display().to_string();
Ok(Json(SaveRecipeResponse {
id: short_id_from_path(&file_path_str),
file_name,
file_path: file_path_str,
}))
}
Err(e) => Err(ErrorResponse {
message: e.to_string(),
status: StatusCode::INTERNAL_SERVER_ERROR,