fix endpoint
This commit is contained in:
parent
0425b92dd7
commit
9df2547ccf
@ -294,7 +294,7 @@ export function usePublicAccounts(
|
|||||||
} = useSWR<
|
} = useSWR<
|
||||||
HttpResponseOk<SandboxBackend.Access.PublicAccountsResponse>,
|
HttpResponseOk<SandboxBackend.Access.PublicAccountsResponse>,
|
||||||
RequestError<SandboxBackend.SandboxError>
|
RequestError<SandboxBackend.SandboxError>
|
||||||
>([`public-accounts`, args?.page, PAGE_SIZE], paginatedFetcher);
|
>([`access-api/public-accounts`, args?.page, PAGE_SIZE], paginatedFetcher);
|
||||||
|
|
||||||
const [lastAfter, setLastAfter] = useState<
|
const [lastAfter, setLastAfter] = useState<
|
||||||
HttpResponse<
|
HttpResponse<
|
||||||
|
@ -21,17 +21,16 @@ import { useState } from "preact/hooks";
|
|||||||
import { Transactions } from "../components/Transactions/index.js";
|
import { Transactions } from "../components/Transactions/index.js";
|
||||||
import { usePublicAccounts } from "../hooks/access.js";
|
import { usePublicAccounts } from "../hooks/access.js";
|
||||||
import { handleNotOkResult } from "./HomePage.js";
|
import { handleNotOkResult } from "./HomePage.js";
|
||||||
|
import { Loading } from "../components/Loading.js";
|
||||||
|
|
||||||
const logger = new Logger("PublicHistoriesPage");
|
const logger = new Logger("PublicHistoriesPage");
|
||||||
|
|
||||||
interface Props {
|
interface Props {}
|
||||||
onLoadNotOk: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show histories of public accounts.
|
* Show histories of public accounts.
|
||||||
*/
|
*/
|
||||||
export function PublicHistoriesPage({ onLoadNotOk }: Props): VNode {
|
export function PublicHistoriesPage({}: Props): VNode {
|
||||||
const { i18n } = useTranslationContext();
|
const { i18n } = useTranslationContext();
|
||||||
|
|
||||||
const result = usePublicAccounts();
|
const result = usePublicAccounts();
|
||||||
@ -43,7 +42,6 @@ export function PublicHistoriesPage({ onLoadNotOk }: Props): VNode {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!result.ok) {
|
if (!result.ok) {
|
||||||
onLoadNotOk();
|
|
||||||
return handleNotOkResult(i18n)(result);
|
return handleNotOkResult(i18n)(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,8 +50,6 @@ export function PublicHistoriesPage({ onLoadNotOk }: Props): VNode {
|
|||||||
const txs: Record<string, h.JSX.Element> = {};
|
const txs: Record<string, h.JSX.Element> = {};
|
||||||
const accountsBar = [];
|
const accountsBar = [];
|
||||||
|
|
||||||
logger.trace(`Public history tab: ${showAccount}`);
|
|
||||||
|
|
||||||
// Ask story of all the public accounts.
|
// Ask story of all the public accounts.
|
||||||
for (const account of data.publicAccounts) {
|
for (const account of data.publicAccounts) {
|
||||||
logger.trace("Asking transactions for", account.accountLabel);
|
logger.trace("Asking transactions for", account.accountLabel);
|
||||||
|
@ -51,13 +51,7 @@ export function Routing(): VNode {
|
|||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/public-accounts"
|
path="/public-accounts"
|
||||||
component={() => (
|
component={() => <PublicHistoriesPage />}
|
||||||
<PublicHistoriesPage
|
|
||||||
onLoadNotOk={() => {
|
|
||||||
route("/account");
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/register"
|
path="/register"
|
||||||
|
Loading…
Reference in New Issue
Block a user