Model fix.
This commit is contained in:
parent
9a9a9aaf33
commit
96d34ebf55
2 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ def save_image(file, model: str) -> str:
|
|||
@image_bp.route("/api/images", methods=["POST"])
|
||||
def upload_image():
|
||||
file = request.files.get("file")
|
||||
model = request.form.get("model")
|
||||
model = request.form.get("target_model")
|
||||
model_id = request.form.get("model_id")
|
||||
caption = request.form.get("caption", "")
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<form method="POST" enctype="multipart/form-data" id="image-upload-form-{{ id }}" class="d-none">
|
||||
<input type="file" id="image-upload-input-{{ id }}" name="file"
|
||||
onchange="ImageWidget.submitImageUpload('{{ id }}')">
|
||||
<input type="hidden" name="model" value="inventory">
|
||||
<input type="hidden" name="target_model" value="inventory">
|
||||
<input type="hidden" name="model_id" value="{{ id }}">
|
||||
<input type="hidden" name="caption" value="Uploaded via UI">
|
||||
</form>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<form method="POST" enctype="multipart/form-data" id="image-upload-form-{{ id }}" class="d-none">
|
||||
<input type="file" id="image-upload-input-{{ id }}" name="file"
|
||||
onchange="ImageWidget.submitImageUpload('{{ id }}')">
|
||||
<input type="hidden" name="model" value="inventory">
|
||||
<input type="hidden" name="target_model" value="inventory">
|
||||
<input type="hidden" name="model_id" value="{{ id }}">
|
||||
<input type="hidden" name="caption" value="Uploaded via UI">
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue