Added data label for backend.

This commit is contained in:
2026-01-31 04:10:51 +01:00
parent 7a35320351
commit 8d15e786ac
9 changed files with 231 additions and 11 deletions
@@ -4,6 +4,7 @@
import {Variant} from "~/types/variant";
import DeleteConfirm from "~/components/ui/deleteConfirm.vue";
import type {Unit} from "~/types/unit";
import type {Label} from "~/types/label";
let store = useLabelEditorStore();
@@ -19,6 +20,8 @@
let unit: Ref<Unit | null> = ref<Unit | null>(JSON.parse(JSON.stringify(props.variant.unit)));
let description: Ref<string | null> = ref<string | null>(JSON.parse(JSON.stringify(props.variant.description)));
let ingredients: Ref<string | null> = ref<string | null>(JSON.parse(JSON.stringify(props.variant.ingredients)));
let label: Ref<Label | null> = ref<Label | null>(JSON.parse(JSON.stringify(props.variant.label)));
let variant_description: Ref<string | null> = ref<string | null>(JSON.parse(JSON.stringify(props.variant.variant_description)));
function toggleEdit() {
if (edit.value) {
@@ -44,7 +47,9 @@
async function updateVariant() {
if (weight.value != null && unit.value != null) {
let updateVariant: Variant = new Variant(props.variant.id, weight.value, ean.value, name.value, description.value, ingredients.value, unit.value);
let updateVariant: Variant = new Variant(props.variant.id, weight.value,
ean.value, name.value, description.value, ingredients.value,
unit.value, label.value, variant_description.value);
await store.updateVariant(updateVariant);