From 0c2f8ec499e46bbefe1d1ba98947519c5f028b14 Mon Sep 17 00:00:00 2001 From: Netervati Date: Wed, 22 Nov 2023 18:37:50 +0800 Subject: [PATCH] Remove unnecessary key --- components/modal/createModel.vue | 7 ++++++- components/modal/editModel.vue | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/modal/createModel.vue b/components/modal/createModel.vue index 45d7f0f..e0f93e0 100644 --- a/components/modal/createModel.vue +++ b/components/modal/createModel.vue @@ -42,10 +42,15 @@ }; const onSubmit = form.handleSubmit(async (values) => { + const data = values.schema.map((sch) => ({ + name: sch.name, + type: sch.type, + })); + await model.create( { name: values.name, - schema: values.schema, + schema: data, }, { onSuccess: () => { diff --git a/components/modal/editModel.vue b/components/modal/editModel.vue index 18f7dd3..6ed04ee 100644 --- a/components/modal/editModel.vue +++ b/components/modal/editModel.vue @@ -49,10 +49,15 @@ }; const onSubmit = form.handleSubmit(async (values) => { + const data = values.schema.map((sch) => ({ + name: sch.name, + type: sch.type, + })); + await model.update( { name: values.name, - schema: values.schema, + schema: data, }, { onSuccess: (updated) => {