Skip to content

Commit

Permalink
bugfixes/fix-stats-deployments (#117)
Browse files Browse the repository at this point in the history
* fix address deployments zod schema

* useless import
  • Loading branch information
baktun14 committed Apr 1, 2024
1 parent e1c12e8 commit 2a9a464
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions stats-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions stats-web/src/queries/useTransactionsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { ApiUrlService } from "@/lib/apiUtils";
import { PaginatedResults, TransactionDetail } from "@/types";
import { removeEmptyFilters } from "@/lib/urlUtils";
import { z } from "zod";
import { transactionRowSchema } from "@/lib/zod/transactionRow";
import { DeploymentRowType } from "@/lib/zod/deploymentRow";
import { DeploymentRowType, deploymentRowSchema } from "@/lib/zod/deploymentRow";

async function getTransactions(limit: number): Promise<TransactionDetail[]> {
const response = await axios.get(ApiUrlService.transactions(limit));
Expand Down Expand Up @@ -37,7 +36,7 @@ export function useAddressTransactions(

async function getAddressDeployments(address: string, skip: number, limit: number, reverseSorting: boolean, filters: { [key: string]: string }) {
const response = await axios.get(ApiUrlService.addressDeployments(address, skip, limit, reverseSorting, filters));
const data = z.array(transactionRowSchema).parse(response.data.results) as unknown as DeploymentRowType[];
const data = z.array(deploymentRowSchema).parse(response.data.results) as unknown as DeploymentRowType[];

return { results: data, count: response.data.count };
}
Expand All @@ -55,4 +54,4 @@ export function useAddressDeployments(
() => getAddressDeployments(address, skip, limit, reverseSorting, removeEmptyFilters(filters)),
options
);
}
}

0 comments on commit 2a9a464

Please sign in to comment.