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