Start adding ui for nutrition.
This commit is contained in:
1 parent
627564e8c6
commit
7986632dab
6 files changed
+124
-14
No files matched your search
@@ -4,6 +4,7 @@
|
||||
import { Variant } from "~/types/variant";
|
||||
import type {Unit} from "~/types/unit";
|
||||
import type {Label} from "~/types/label";
|
||||
import type {Nutritional} from "~/types/nutritional.ts";
|
||||
|
||||
let store = useLabelEditorStore();
|
||||
|
||||
@@ -33,7 +34,7 @@
|
||||
|
||||
const variant: Variant = new Variant(0, weight.value, ean.value, name.value,
|
||||
description.value, ingredients.value, unit.value, label.value,
|
||||
variant_description.value, topm_row.value);
|
||||
variant_description.value, topm_row.value, null);
|
||||
|
||||
await store.addVariant(variant);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user