Start adding ui for nutrition.

This commit is contained in:
matthias committed 2026-09-28 00:45:43 +02:00
1 parent 627564e8c6
commit 7986632dab
6 files changed
+124 -14

No files matched your search

@@ -5,6 +5,7 @@
import DeleteConfirm from "~/components/ui/deleteConfirm.vue";
import type {Unit} from "~/types/unit";
import type {Label} from "~/types/label";
import type {Nutritional} from "~/types/nutritional.ts";
let store = useLabelEditorStore();
@@ -23,6 +24,7 @@
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)));
let topm_row: Ref<string | null> = ref<string | null>(JSON.parse(JSON.stringify(props.variant.topm_row)));
let nutrition: Ref<Nutritional | null> = ref<Nutritional | null>(JSON.parse(JSON.stringify(props.variant.nutritional)));
function toggleEdit() {
if (edit.value) {
@@ -51,7 +53,7 @@
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, label.value, variant_description.value, topm_row.value);
unit.value, label.value, variant_description.value, topm_row.value, nutrition.value);
await store.updateVariant(updateVariant);