@@ -116,26 +116,28 @@ export default class CreateDetector extends Component<CreateDetectorProps, Creat
116
116
errorNotificationToast (
117
117
this . props . notifications ,
118
118
'create' ,
119
- 'field mappings' ,
120
- createMappingsRes . error
121
- ) ;
122
- }
123
-
124
- const createDetectorRes = await this . props . services . detectorsService . createDetector ( detector ) ;
125
- if ( createDetectorRes . ok ) {
126
- successNotificationToast (
127
- this . props . notifications ,
128
- 'created' ,
129
- `detector, "${ detector . name } "`
119
+ 'detector' ,
120
+ 'Double check the field mappings and try again.'
130
121
) ;
131
- this . props . history . push ( `${ ROUTES . DETECTOR_DETAILS } /${ createDetectorRes . response . _id } ` ) ;
132
122
} else {
133
- errorNotificationToast (
134
- this . props . notifications ,
135
- 'create' ,
136
- 'detector' ,
137
- createDetectorRes . error
123
+ const createDetectorRes = await this . props . services . detectorsService . createDetector (
124
+ detector
138
125
) ;
126
+ if ( createDetectorRes . ok ) {
127
+ successNotificationToast (
128
+ this . props . notifications ,
129
+ 'created' ,
130
+ `detector, "${ detector . name } "`
131
+ ) ;
132
+ this . props . history . push ( `${ ROUTES . DETECTOR_DETAILS } /${ createDetectorRes . response . _id } ` ) ;
133
+ } else {
134
+ errorNotificationToast (
135
+ this . props . notifications ,
136
+ 'create' ,
137
+ 'detector' ,
138
+ createDetectorRes . error
139
+ ) ;
140
+ }
139
141
}
140
142
} catch ( error : any ) {
141
143
errorNotificationToast ( this . props . notifications , 'create' , 'detector' , error ) ;
0 commit comments