@@ -174,25 +174,45 @@ class FeedForm extends React.Component {
174174 async fetchData ( isNew ) {
175175 // trick to remove feed by uuid if feedlist not loads because of corrupted data
176176 // this.deleteFeedByUuid("01018dcf-2d90-44a0-8f0c-d0a90e85aee5");
177+
178+ const config = await this . getApplicationConfig ( ) ;
179+ let stores , listObject , feed ; // Declare variables outside the blocks
180+
177181 if ( isNew === true ) {
178182 console . log ( 'fetch data for "New feed"' ) ;
179183
180- const [ stores , listObject ] = await Promise . all ( [
181- this . getStores ( ) ,
182- this . getSubTypesForObject ( "ProductView" )
183- ] )
184+ if ( config . ims !== true ) {
185+ [ stores , listObject ] = await Promise . all ( [
186+ this . getStores ( ) ,
187+ this . getSubTypesForObject ( "ProductInterface" )
188+ ] )
189+ } else {
190+ [ stores , listObject ] = await Promise . all ( [
191+ this . getStores ( ) ,
192+ this . getSubTypesForObject ( "ProductView" )
193+ ] )
194+ }
184195 this . setState ( {
185196 autocompleteList : listObject
186197 } ) ;
187198 return [ stores , listObject ] ;
188199 }
189200
190201 console . log ( 'fetch data for "Existing feed"' ) ;
191- const [ stores , listObject , feed ] = await Promise . all ( [
192- this . getStores ( ) ,
193- this . getSubTypesForObject ( "ProductView" ) ,
194- this . getFeedByUuid ( this . props . feedUuid )
195- ] )
202+
203+ if ( config . ims !== true ) {
204+ [ stores , listObject , feed ] = await Promise . all ( [
205+ this . getStores ( ) ,
206+ this . getSubTypesForObject ( "ProductInterface" ) ,
207+ this . getFeedByUuid ( this . props . feedUuid )
208+ ] )
209+ } else {
210+ [ stores , listObject , feed ] = await Promise . all ( [
211+ this . getStores ( ) ,
212+ this . getSubTypesForObject ( "ProductView" ) ,
213+ this . getFeedByUuid ( this . props . feedUuid )
214+ ] )
215+ }
196216 this . setState ( {
197217 autocompleteList : listObject
198218 } ) ;
0 commit comments