Skip to content

Commit

Permalink
Merge pull request #2142 from moreal/feat/dashboard/use-9c-headless
Browse files Browse the repository at this point in the history
feat(Dashboard): use 9c-headless instead of empty-chronicle
  • Loading branch information
moreal authored Sep 14, 2023
2 parents 6a5fd2f + 2b7efa7 commit 9b9db0c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@ import { useQueries } from "@tanstack/react-query";
import axios from "axios";
import { useMemo } from "react";

interface Block { index: number }
interface GraphQLTipIndexResponse {
data: {
chainQuery: {
blockQuery: {
block: {
index: number,
}
}
}
}
};
interface Action { id: string, obsoleteAt: number }

const fetchLatestBlock = async () => {
const response = await axios.get<Block>(`${import.meta.env.VITE_API_PATH}/api/blocks/latest`);
return response.data;
const response = await axios.post<GraphQLTipIndexResponse>(`${import.meta.env.VITE_API_PATH}/graphql`, {
query: `query { chainQuery { blockQuery { block(index: -1) { index } } } }`,
variables: {},
operationName: null,
});
return response.data.data.chainQuery.blockQuery.block;
};

const fetchActions = async () => {
Expand Down

0 comments on commit 9b9db0c

Please sign in to comment.