aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-04-26 10:37:11 -0300
committerSebastian <sebasjm@gmail.com>2023-04-26 10:37:32 -0300
commit9df2547ccf74d7cf5294e16a5f5f7c074dd301b7 (patch)
tree73207edb79ec7c6fbb86c500b61445d5c9fff793
parent0425b92dd7eb68818042740fe3751c9290738403 (diff)
fix endpoint
-rw-r--r--packages/demobank-ui/src/hooks/access.ts2
-rw-r--r--packages/demobank-ui/src/pages/PublicHistoriesPage.tsx10
-rw-r--r--packages/demobank-ui/src/pages/Routing.tsx8
3 files changed, 5 insertions, 15 deletions
diff --git a/packages/demobank-ui/src/hooks/access.ts b/packages/demobank-ui/src/hooks/access.ts
index 5eddec033..96661ed95 100644
--- a/packages/demobank-ui/src/hooks/access.ts
+++ b/packages/demobank-ui/src/hooks/access.ts
@@ -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<
diff --git a/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx b/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx
index 256653dc5..796935373 100644
--- a/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx
+++ b/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx
@@ -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);
diff --git a/packages/demobank-ui/src/pages/Routing.tsx b/packages/demobank-ui/src/pages/Routing.tsx
index 27aae69e9..d3aaae542 100644
--- a/packages/demobank-ui/src/pages/Routing.tsx
+++ b/packages/demobank-ui/src/pages/Routing.tsx
@@ -51,13 +51,7 @@ export function Routing(): VNode {
/>
<Route
path="/public-accounts"
- component={() => (
- <PublicHistoriesPage
- onLoadNotOk={() => {
- route("/account");
- }}
- />
- )}
+ component={() => <PublicHistoriesPage />}
/>
<Route
path="/register"