fix endpoint

This commit is contained in:
Sebastian 2023-04-26 10:37:11 -03:00
parent 0425b92dd7
commit 9df2547ccf
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
3 changed files with 5 additions and 15 deletions

View File

@ -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<

View File

@ -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);

View File

@ -51,13 +51,7 @@ export function Routing(): VNode {
/>
<Route
path="/public-accounts"
component={() => (
<PublicHistoriesPage
onLoadNotOk={() => {
route("/account");
}}
/>
)}
component={() => <PublicHistoriesPage />}
/>
<Route
path="/register"