diff --git a/client/blueprints/measure.py b/client/blueprints/measure.py index 5d7bb45..b0eae1d 100644 --- a/client/blueprints/measure.py +++ b/client/blueprints/measure.py @@ -124,21 +124,15 @@ def task_execute(task_id: int): # Load all task IDs for this recipe (ordered) for auto-advance recipe_id = task_resp.get("recipe_id") all_task_ids = [] - recipe_resp = {} if recipe_id: tasks_resp = api_client.get(f"/api/recipes/{recipe_id}/tasks") if isinstance(tasks_resp, list): sorted_tasks = sorted(tasks_resp, key=lambda t: t.get("order_index", 0)) all_task_ids = [t["id"] for t in sorted_tasks] - # Fetch recipe for image_path - resp = api_client.get(f"/api/recipes/{recipe_id}") - if not (isinstance(resp, dict) and resp.get("error")): - recipe_resp = resp return render_template( "measure/task_execute.html", task=task_resp, - recipe=recipe_resp, lot_number=lot_number, serial_number=serial_number, all_task_ids=all_task_ids, diff --git a/client/templates/maker/recipe_editor.html b/client/templates/maker/recipe_editor.html index d8b05d7..ac0fc8a 100644 --- a/client/templates/maker/recipe_editor.html +++ b/client/templates/maker/recipe_editor.html @@ -438,8 +438,8 @@ function recipeEditor() { versions: {{ (recipe.versions if recipe and recipe.versions else [])|tojson }}, currentVersion: {{ (recipe.current_version.version_number if recipe and recipe.current_version else 0)|tojson }}, - // ---- File upload (thumbnail) ---- - currentFilePath: {{ (recipe.current_version.tasks[0].file_path if recipe and recipe.current_version and recipe.current_version.tasks and recipe.current_version.tasks|length > 0 and recipe.current_version.tasks[0].file_path else '')|tojson }}, + // ---- File upload (preview image) ---- + currentFilePath: {{ (recipe.image_path if recipe and recipe.image_path else '')|tojson }}, uploadingFile: false, dragOver: false, @@ -459,9 +459,9 @@ function recipeEditor() { description: this.description.trim(), }; - // Include file_path for thumbnail + // Include image_path for preview thumbnail if (this.currentFilePath) { - payload.file_path = this.currentFilePath; + payload.image_path = this.currentFilePath; } // Include change notes if editing diff --git a/client/templates/maker/recipe_list.html b/client/templates/maker/recipe_list.html index 36c8027..1b0e9ea 100644 --- a/client/templates/maker/recipe_list.html +++ b/client/templates/maker/recipe_list.html @@ -153,9 +153,9 @@