Skip to content

Commit

Permalink
Use tracing api instead of json file
Browse files Browse the repository at this point in the history
  • Loading branch information
abefernan committed Sep 16, 2024
1 parent 1eee9a7 commit 6ee9bf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/tx-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export default function TxData({ txId, spanId }: TxDataProps) {
} = useQuery({
queryKey: [`tx-${txId}`],
queryFn: () =>
fetch("/txs.json")
fetch(`http://localhost:4000/api/v1/txs?traceID=${txId}`)
.then((res) => res.json())
.then((obj) => obj.txs.filter((tx: Tx) => tx._source.traceID === txId)),
.then((json) => json.txs),
});

if (isPending) return "Loading...";
Expand Down
3 changes: 2 additions & 1 deletion components/txs-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Link from "next/link";
export default function TxsData() {
const { isPending, error, data } = useQuery({
queryKey: ["txs"],
queryFn: () => fetch("/txs.json").then((res) => res.json()),
queryFn: () =>
fetch("http://localhost:4000/api/v1/txs").then((res) => res.json()),
});

if (isPending) return "Loading...";
Expand Down

0 comments on commit 6ee9bf7

Please sign in to comment.