@@ -77,15 +77,15 @@ export const Dashboard: () => JSX.Element = () => {
7777 }
7878
7979 Promise . all ( [
80- fetchWithCredentials ( `/api/v1/network/organizations?limit=100 ` ) ,
80+ fetchWithCredentials ( `/api/v1/network/organizations?count&created=>=0 ` ) ,
8181 fetchWithCredentials (
82- `/api/v1/namespaces/${ namespace } /data?limit=200 ${ createdFilterString } `
82+ `/api/v1/namespaces/${ namespace } /data?count ${ createdFilterString } `
8383 ) ,
8484 fetchWithCredentials (
85- `/api/v1/namespaces/${ namespace } /messages?limit=200 ${ createdFilterString } `
85+ `/api/v1/namespaces/${ namespace } /messages?limit=5&count ${ createdFilterString } `
8686 ) ,
8787 fetchWithCredentials (
88- `/api/v1/namespaces/${ namespace } /transactions?limit=200 &created=>=${ dayjs ( )
88+ `/api/v1/namespaces/${ namespace } /transactions?count &created=>=${ dayjs ( )
8989 . subtract ( 24 , 'hours' )
9090 . unix ( ) } ${ createdFilterString } `
9191 ) ,
@@ -97,10 +97,14 @@ export const Dashboard: () => JSX.Element = () => {
9797 messageResponse . ok &&
9898 txResponse . ok
9999 ) {
100- setMessages ( await messageResponse . json ( ) ) ;
101- setTransactions ( await txResponse . json ( ) ) ;
102- setOrgs ( await orgResponse . json ( ) ) ;
103- setData ( await dataResponse . json ( ) ) ;
100+ const messageJson = await messageResponse . json ( ) ;
101+ const dataJson = await dataResponse . json ( ) ;
102+ const txJson = await txResponse . json ( ) ;
103+ const orgJson = await orgResponse . json ( ) ;
104+ setMessages ( messageJson . items ) ;
105+ setTransactions ( txJson . items ) ;
106+ setData ( dataJson . items ) ;
107+ setOrgs ( orgJson . items ) ;
104108 }
105109 }
106110 ) ;
@@ -126,9 +130,8 @@ export const Dashboard: () => JSX.Element = () => {
126130 t ( 'createdOn' ) ,
127131 ] ;
128132
129- const messageRecords : IDataTableRecord [ ] = messages
130- . slice ( 0 , 5 )
131- . map ( ( message : IMessage ) => ( {
133+ const messageRecords : IDataTableRecord [ ] = messages . map (
134+ ( message : IMessage ) => ( {
132135 key : message . header . id ,
133136 columns : [
134137 {
@@ -154,7 +157,8 @@ export const Dashboard: () => JSX.Element = () => {
154157 value : dayjs ( message . header . created ) . format ( 'MM/DD/YYYY h:mm A' ) ,
155158 } ,
156159 ] ,
157- } ) ) ;
160+ } )
161+ ) ;
158162
159163 return (
160164 < Grid container justify = "center" >
0 commit comments