File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/modules/SurveyInformation/SurveyStatusMapping Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,6 @@ function SurveyStatusMapping() {
164164 setEditingData ( rowData ) ;
165165 setEditingMode ( "edit" ) ;
166166 } ;
167-
168167 const onAddMapping = ( ) => {
169168 if ( ! sctoForm . form_uid ) return ;
170169
@@ -183,7 +182,7 @@ function SurveyStatusMapping() {
183182 }
184183
185184 // Check if survey status and survey status label already exists
186- targetStatusMapping . forEach ( ( ele : any ) => {
185+ for ( const ele of targetStatusMapping ) {
187186 if ( ele . survey_status === parseInt ( editingData . survey_status ) ) {
188187 message . error (
189188 "Survey status already exists, please add unique survey status!"
@@ -200,15 +199,15 @@ function SurveyStatusMapping() {
200199 ) ;
201200 return ;
202201 }
203- } ) ;
202+ }
204203
205204 dispatch (
206205 updateTargetStatusMapping ( {
207206 formUID : sctoForm . form_uid ,
208207 data : [ ...targetStatusMapping , editingData ] ,
209208 } )
210209 ) . then ( ( res ) => {
211- if ( res . payload . data . success ) {
210+ if ( res . payload . data && res . payload . data . success === true ) {
212211 message . success ( "Mapping added successfully!" ) ;
213212 setEditingMode ( null ) ;
214213 setSelectedRowKeys ( [ ] ) ;
You can’t perform that action at this time.
0 commit comments