-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#932] Automated voting options voting power fix
- Loading branch information
1 parent
5959680
commit 7fd51e9
Showing
6 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
govtool/frontend/src/hooks/queries/useGetNetworkMetrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useQuery } from "react-query"; | ||
|
||
import { getNetworkMetrics } from "@services"; | ||
import { QUERY_KEYS } from "@consts"; | ||
import { useCardano } from "@/context"; | ||
|
||
export const useGetNetworkMetrics = () => { | ||
const { isEnabled } = useCardano(); | ||
|
||
const { data } = useQuery({ | ||
queryKey: QUERY_KEYS.useGetNetworkMetricsKey, | ||
queryFn: () => getNetworkMetrics(), | ||
enabled: isEnabled, | ||
}); | ||
|
||
return { networkMetrics: data }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { API } from "../API"; | ||
|
||
export const getNetworkMetrics = async () => { | ||
const response = await API.get("/network/metrics"); | ||
|
||
return response.data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters