Skip to content

Commit

Permalink
Merge pull request #185 from chain4travel/explorer-address-detail
Browse files Browse the repository at this point in the history
chore: Update XAddressDetail.tsx to include chainID in API request
  • Loading branch information
Ysrbolles authored Jul 10, 2024
2 parents 6000015 + 9744766 commit ee56591
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/pages/XChainPages/Address/XAddressDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TabPanel from 'app/components/TabComponent/TabPanel'
import TabsHeader from 'app/components/TabComponent/TabsHeader'
import XPAddressView from './XPAddressView'
import axios from 'axios'
import { getBaseUrl } from 'api/utils'
import { getBaseUrl, getChainID } from 'api/utils'
import { mdiFileDocumentOutline } from '@mdi/js'
import { useLocation } from 'react-router-dom'

Expand Down Expand Up @@ -56,7 +56,11 @@ export default function XAddressDetail() {
async function loadBalances(address: string | undefined) {
const assets = await loadAssets()
const addressInfo = await (
await axios.get(`${getBaseUrl()}${addressesApi}/${address}`)
await axios.get(
`${getBaseUrl()}${addressesApi}/${address}?chainID=${getChainID(
getAddressFromUrl()[0].toLowerCase(),
)}`,
)
).data
const addressBalances: AddressBalance[] = []
if (addressInfo && addressInfo.assets) {
Expand Down

0 comments on commit ee56591

Please sign in to comment.