Skip to content

Commit

Permalink
added missing params
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadex committed Feb 2, 2024
1 parent d117b6d commit c83f567
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/web/src/api/TokensApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
itemsCount?: string,
marketCap?: string,
name?: string,
fiat_value?: string,
): Promise<RawTokenWithPaginationProps> => {
const rpcUrl = getRpcUrl(network);
const params = filterParams([
Expand All @@ -24,6 +25,7 @@ export default {
{ key: "items_count", value: itemsCount },
{ key: "market_cap", value: marketCap },
{ key: "name", value: name },
{ key: "fiat_value", value: fiat_value },
]);
const res = await fetch(`${rpcUrl}/${TOKENS_URL}${params}`);

Expand All @@ -38,6 +40,7 @@ export interface TokenNextPageParamsProps {
items_count: string;
market_cap?: string;
name?: string;
fiat_value?: string;
}

export interface TokenQueryParamsProps extends TokenNextPageParamsProps {
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/pages/tokens/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function TokenPagination({
is_name_null: nextPageParams.is_name_null,
market_cap: nextPageParams.market_cap ?? "null",
name: nextPageParams.name,
fiat_value: nextPageParams.fiat_value ?? "null",
}
: undefined
}
Expand Down Expand Up @@ -107,7 +108,8 @@ export async function getServerSideProps(
!isNumeric(params?.holder_count as string) ||
!isAlphanumeric(params?.is_name_null as string) ||
!isNumeric(params?.items_count as string) ||
!isAlphanumeric(params?.market_cap as string);
!isAlphanumeric(params?.market_cap as string) ||
!isAlphanumeric(params?.fiat_value as string);

try {
// Fetch data from external API
Expand All @@ -121,6 +123,7 @@ export async function getServerSideProps(
params?.items_count as string,
params?.market_cap as string,
params?.name as string,
params?.fiat_value as string,
);
const data = {
tokens: txs.items,
Expand Down

0 comments on commit c83f567

Please sign in to comment.