diff --git a/src/store/actions.ts b/src/store/actions.ts index af139e98c..91ece34de 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -489,14 +489,18 @@ export const resubmit = async ({ commit, getters }): Promise => { // add resubmit NR number (for internal use only - API ignores it) nrTypeData['resubmitNrNum'] = nrData['nrNum'] - + // check against entity types if it should have designation or not : if length returns to be 0 then NR should not have any designation otherwise work as getNameDesignation + let flag = false + if (Designations[nrData['entity_type_cd']].words.length === 0) { + flag = true + } // clean names data nrTypeData['names'] = nrData.names.map(name => ({ choice: name.choice, consent_words: '', conflict1: '', conflict1_num: '', - designation: getNameDesignation(name), + designation: !flag ? getNameDesignation(name) : '', name: name.name, name_type_cd: name.name_type_cd })) @@ -525,7 +529,6 @@ function getNameDesignation (name: any): string { if (name.designation) return name.designation const words = name.name.split(' ') const len = words.length - if (EntityTypes.FR || EntityTypes.GP || EntityTypes.DBA || EntityTypes.FI || EntityTypes.PA || EntityTypes.PAR) return '' return words[len - 1] }