@@ -385,7 +385,7 @@ export const useProgramDraftStore = defineStore('programDraft', () => {
385385 }
386386
387387 draft . value . entityForms . forEach ( ( form ) => {
388- const formErrors : { name ?: string ; title ?: string ; formio ?: string } = { }
388+ const formErrors : { name ?: string ; title ?: string ; formio ?: string ; entityType ?: string } = { }
389389 if ( ! form . name . trim ( ) ) {
390390 formErrors . name = 'Name is required'
391391 valid = false
@@ -394,6 +394,10 @@ export const useProgramDraftStore = defineStore('programDraft', () => {
394394 formErrors . title = 'Title is required'
395395 valid = false
396396 }
397+ if ( ! form . entityType ) {
398+ formErrors . entityType = 'Entity type is required'
399+ valid = false
400+ }
397401 if ( ! form . formio ) {
398402 formErrors . formio = 'Form definition is required'
399403 valid = false
@@ -614,10 +618,9 @@ export const useProgramDraftStore = defineStore('programDraft', () => {
614618 description : draft . value . description ,
615619 version : draft . value . version ,
616620 entityForms : draft . value . entityForms . map ( ( form ) => {
617- const { entityType , nameField, ...rest } = form
621+ const { nameField, ...rest } = form
618622 const withId = { id : form . name , ...rest }
619- const withType = entityType ? { ...withId , entityType } : withId
620- return nameField ? { ...withType , nameField } : withType
623+ return nameField ? { ...withId , nameField } : withId
621624 } ) ,
622625 externalSync : draft . value . externalSync ,
623626 authConfigs : draft . value . authConfigs ,
0 commit comments