kopia lustrzana https://github.com/bugout-dev/moonstream
fix of route
rodzic
ad8d4767dc
commit
e519cabad9
|
@ -42,3 +42,4 @@ async def version_handler() -> data.VersionResponse:
|
||||||
app.mount("/subscriptions", subscriptions_api)
|
app.mount("/subscriptions", subscriptions_api)
|
||||||
app.mount("/users", users_api)
|
app.mount("/users", users_api)
|
||||||
app.mount("/streams", streams_api)
|
app.mount("/streams", streams_api)
|
||||||
|
app.mount("/txinfo", txinfo_api)
|
|
@ -11,7 +11,7 @@ fastapi==0.66.0
|
||||||
h11==0.12.0
|
h11==0.12.0
|
||||||
idna==3.2
|
idna==3.2
|
||||||
jmespath==0.10.0
|
jmespath==0.10.0
|
||||||
-e git+https://git@github.com/bugout-dev/moonstream.git@3326379b174a626cf876c7b60dd7db8afe2daba9#egg=moonstreamdb&subdirectory=db
|
-e git+https://git@github.com/bugout-dev/moonstream.git@5946abb75bb91f27dbcf93dc15be205700dc7a51#egg=moonstreamdb&subdirectory=db
|
||||||
mypy==0.910
|
mypy==0.910
|
||||||
mypy-extensions==0.4.3
|
mypy-extensions==0.4.3
|
||||||
pathspec==0.9.0
|
pathspec==0.9.0
|
||||||
|
|
|
@ -42,7 +42,12 @@ const raw_transaction = {
|
||||||
"value": 0
|
"value": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const test = useTxInfo(raw_transaction)
|
async function test() {
|
||||||
|
const testt = await useTxInfo(raw_transaction)
|
||||||
|
console.log(testt)
|
||||||
|
|
||||||
|
}
|
||||||
|
test()
|
||||||
console.log(test)
|
console.log(test)
|
||||||
let isFetchedAfterMount = false;
|
let isFetchedAfterMount = false;
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
|
@ -13,7 +13,7 @@ const StreamEntry = ({ entry, filterCallback, filterConstants }) => {
|
||||||
ui.setEntryId(entryId);
|
ui.setEntryId(entryId);
|
||||||
ui.setEntriesViewMode("entry");
|
ui.setEntriesViewMode("entry");
|
||||||
router.push({
|
router.push({
|
||||||
pathname: `/stream/${entry.id}`,
|
pathname: `/stream/${entry.hash}`,
|
||||||
query: router.query,
|
query: router.query,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -92,7 +92,7 @@ const StreamEntry = ({ entry, filterCallback, filterConstants }) => {
|
||||||
boxSize="32px"
|
boxSize="32px"
|
||||||
colorScheme="primary"
|
colorScheme="primary"
|
||||||
icon={<ViewIcon />}
|
icon={<ViewIcon />}
|
||||||
onClick={() => handleViewClicked(entry.id)}
|
onClick={() => handleViewClicked(entry)}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,13 +4,14 @@ import { queryCacheProps } from "./hookCommon";
|
||||||
import { useToast } from ".";
|
import { useToast } from ".";
|
||||||
|
|
||||||
const useTxInfo = (transaction) => {
|
const useTxInfo = (transaction) => {
|
||||||
|
console.log("Use hook", transaction)
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const getTxInfo = async () => {
|
const getTxInfo = async () => {
|
||||||
const data = await TxInfoService.getTxInfo(transaction);
|
const response = await TxInfoService.getTxInfo(transaction);
|
||||||
return data;
|
return response.data;
|
||||||
}
|
}
|
||||||
const { data, isLoading, isFetchedAfterMount, refetch, isError, error } =
|
const { data, isLoading, isFetchedAfterMount, refetch, isError, error } =
|
||||||
useQuery(["txinfo", {transaction}], getTxInfo, {
|
useQuery(["txinfo", transaction.tx.hash ], getTxInfo, {
|
||||||
...queryCacheProps,
|
...queryCacheProps,
|
||||||
onError: (error) => toast(error, "error"),
|
onError: (error) => toast(error, "error"),
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,10 +2,9 @@ import { http } from "../utils";
|
||||||
|
|
||||||
const API = process.env.NEXT_PUBLIC_MOONSTREAM_API_URL;
|
const API = process.env.NEXT_PUBLIC_MOONSTREAM_API_URL;
|
||||||
|
|
||||||
export const getTxInfo = (tx) => {
|
export const getTxInfo = (tx) =>
|
||||||
http({
|
http({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: `${API}/txinfo/ethereum_blockchain`,
|
url: `${API}/txinfo/ethereum_blockchain`,
|
||||||
tx
|
data: tx
|
||||||
})
|
});
|
||||||
}
|
|
||||||
|
|
Ładowanie…
Reference in New Issue