File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,21 @@ class Contentstack {
5151
5252 if ( item . _content_type_uid == 'sys_assets' && item . filename ) {
5353
54- const correspondingAsset = entry [ key ] . children . find ( child => child . attrs [ 'asset-uid' ] === item . uid ) ;
54+ let correspondingAsset ;
55+ const x = ( children ) => {
56+ for ( let i = 0 ; i < children . length ; i ++ ) {
57+ if ( children [ i ] . children && children [ i ] . children . length ) {
58+ x ( children [ i ] . children ) ;
59+ }
60+ if ( children [ i ] . attrs && children [ i ] . attrs [ 'asset-uid' ] === item . uid ) {
61+ correspondingAsset = children [ i ] . attrs ;
62+ return ;
63+ }
64+ }
65+ }
66+ x ( entry [ key ] . children ) ;
5567 if ( correspondingAsset ) {
56- correspondingAsset . attrs [ 'asset-link '] = item . url ;
68+ correspondingAsset [ 'href '] = item . url ;
5769 }
5870 }
5971 } ) ;
You can’t perform that action at this time.
0 commit comments