Skip to content

Commit

Permalink
fix: remove year of api path
Browse files Browse the repository at this point in the history
  • Loading branch information
vien.nguyen2-tiki committed Mar 3, 2023
1 parent 88b813d commit 0cb01a4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
8 changes: 2 additions & 6 deletions views/charts/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ function convertAddressGrowthToDataSet(history: AddressGrowthItem[]): [string[],
}

export default function Address() {
const { data: activeAddressRes } = useSWR<ActiveAddressResponse>(
API_LIST.GET_ACTIVE_ADDRESS.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: addressGrowthRes } = useSWR<AddressGrowthResponse>(
API_LIST.GET_ADDRESS_GROWTH.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: activeAddressRes } = useSWR<ActiveAddressResponse>(API_LIST.GET_ACTIVE_ADDRESS)
const { data: addressGrowthRes } = useSWR<AddressGrowthResponse>(API_LIST.GET_ADDRESS_GROWTH)

const activeAddress = activeAddressRes?.result?.activeAddressesHistory || []
const [activeAddressLabels, activeAddressdata] = convertActiveAddressToDataSet(activeAddress)
Expand Down
8 changes: 2 additions & 6 deletions views/charts/Fee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ function convertFeeToDataSet(history: FeeItem[], convertDecimal?: boolean): [str
}

export default function Fee() {
const { data: feeDailyRes } = useSWR<FeeResponse>(
API_LIST.GET_FEE_DAILY.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: feeMonthRes } = useSWR<FeeResponse>(
API_LIST.GET_FEE_MONTHLY.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: feeDailyRes } = useSWR<FeeResponse>(API_LIST.GET_FEE_DAILY)
const { data: feeMonthRes } = useSWR<FeeResponse>(API_LIST.GET_FEE_MONTHLY)

const feeDaily = feeDailyRes?.result?.totalFeesHistory || []
const [feeDailyLabels, feeDailyData] = convertFeeToDataSet(feeDaily)
Expand Down
4 changes: 1 addition & 3 deletions views/charts/FeeBurn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ function convertFeeToDataSet(history: FeeItem[], convertDecimal?: boolean): [str
}

export default function FeeBurn() {
const { data: feeDailyRes } = useSWR<FeeResponse>(
API_LIST.GET_FEE_DAILY.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: feeDailyRes } = useSWR<FeeResponse>(API_LIST.GET_FEE_DAILY)
const feeDaily = feeDailyRes?.result?.totalFeesHistory || []
const [feeDailyLabels, feeDailyData] = convertFeeToDataSet(feeDaily)

Expand Down
8 changes: 2 additions & 6 deletions views/charts/Gas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ function convertGasToDataSet(history: GasItem[]): [string[], number[]] {
}

export default function Gas() {
const { data: gasDailyRes } = useSWR<GasResponse>(
API_LIST.GET_GAS_DAILY.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: gasMonthRes } = useSWR<GasResponse>(
API_LIST.GET_GAS_MONTHLY.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: gasDailyRes } = useSWR<GasResponse>(API_LIST.GET_GAS_DAILY)
const { data: gasMonthRes } = useSWR<GasResponse>(API_LIST.GET_GAS_MONTHLY)

const gasDaily = gasDailyRes?.result?.totalGasUsedHistory || []
const [gasDailyLabels, gasDailyData] = convertGasToDataSet(gasDaily)
Expand Down
4 changes: 1 addition & 3 deletions views/charts/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ function convertToDataSet(history: TransactionHistoryItem[]): [string[], number[
}

export default function Transactions() {
const { data: res } = useSWR<TransactionHistoryResponse>(
API_LIST.GET_TRANSACTION_HISTORY.replace('#YEAR', new Date().getFullYear().toString())
)
const { data: res } = useSWR<TransactionHistoryResponse>(API_LIST.GET_TRANSACTION_HISTORY)
const history = res?.result?.transactionsHistory || []
const [labels, data] = convertToDataSet(history)
return (
Expand Down

0 comments on commit 0cb01a4

Please sign in to comment.