File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,7 +165,18 @@ export const ObjectGantt: React.FC<ObjectGanttProps> = ({
165165 $filter : schema . filter ,
166166 $orderby : convertSortToQueryParams ( schema . sort ) ,
167167 } ) ;
168- setData ( result ?. data || [ ] ) ;
168+
169+ let items : any [ ] = [ ] ;
170+ if ( Array . isArray ( result ) ) {
171+ items = result ;
172+ } else if ( result && typeof result === 'object' ) {
173+ if ( Array . isArray ( ( result as any ) . data ) ) {
174+ items = ( result as any ) . data ;
175+ } else if ( Array . isArray ( ( result as any ) . value ) ) {
176+ items = ( result as any ) . value ;
177+ }
178+ }
179+ setData ( items ) ;
169180 } else if ( dataConfig ?. provider === 'api' ) {
170181 console . warn ( 'API provider not yet implemented for ObjectGantt' ) ;
171182 setData ( [ ] ) ;
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ export const ObjectGallery = (props: any) => {
3434 } else if ( results && typeof results === 'object' ) {
3535 if ( Array . isArray ( ( results as any ) . value ) ) {
3636 data = ( results as any ) . value ;
37+ } else if ( Array . isArray ( ( results as any ) . data ) ) {
38+ data = ( results as any ) . data ;
3739 }
3840 }
3941
Original file line number Diff line number Diff line change @@ -254,7 +254,18 @@ export const ObjectMap: React.FC<ObjectMapProps> = ({
254254 $filter : schema . filter ,
255255 $orderby : convertSortToQueryParams ( schema . sort ) ,
256256 } ) ;
257- setData ( result ?. data || [ ] ) ;
257+
258+ let items : any [ ] = [ ] ;
259+ if ( Array . isArray ( result ) ) {
260+ items = result ;
261+ } else if ( result && typeof result === 'object' ) {
262+ if ( Array . isArray ( ( result as any ) . data ) ) {
263+ items = ( result as any ) . data ;
264+ } else if ( Array . isArray ( ( result as any ) . value ) ) {
265+ items = ( result as any ) . value ;
266+ }
267+ }
268+ setData ( items ) ;
258269 } else if ( dataConfig ?. provider === 'api' ) {
259270 console . warn ( 'API provider not yet implemented for ObjectMap' ) ;
260271 setData ( [ ] ) ;
You can’t perform that action at this time.
0 commit comments