From d5484642025d5aa4d8a8342f309928e521242579 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Thu, 2 Nov 2023 21:48:00 +0100 Subject: [PATCH] Switch Create to NicerForm --- .../pages/[subsystem]/[entity]/edit/index.vue | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/client/src/pages/[subsystem]/[entity]/edit/index.vue b/client/src/pages/[subsystem]/[entity]/edit/index.vue index 31586e5..e7b097d 100644 --- a/client/src/pages/[subsystem]/[entity]/edit/index.vue +++ b/client/src/pages/[subsystem]/[entity]/edit/index.vue @@ -7,16 +7,18 @@ const p = getPlugins(); const props = $defineProps<{subsystem: string, entity: string}>(); const { subsystem, entity } = $(props); -async function create(value: any) { - console.debug('value', value); +let vm: any = $ref({}); + +async function create() { + console.debug('value', vm); let res: any; if (editTypes[subsystem][entity].idType == 'Number') { - res = await apiCall(`${subsystem }.${entity}.create`, value); + res = await apiCall(`${subsystem }.${entity}.create`, vm); } else { // TODO find way to only have a name/id field in the form on create and not put it into the value - let id = value.name; - delete value.name; - res = await apiCall(`${subsystem }.${entity}.create`, {id: id, thing: value}); + let id = vm.name; + delete vm.name; + res = await apiCall(`${subsystem }.${entity}.create`, {id: id, thing: vm}); } if (res.Error === null) { @@ -32,7 +34,15 @@ async function create(value: any) {
- + +
+
+ +
+ +
+
+

{{ vm }}