diff options
Diffstat (limited to 'packages/bank-ui/src/pages')
-rw-r--r-- | packages/bank-ui/src/pages/PublicHistoriesPage.tsx | 10 | ||||
-rw-r--r-- | packages/bank-ui/src/pages/admin/AccountList.tsx | 8 | ||||
-rw-r--r-- | packages/bank-ui/src/pages/admin/AdminHome.tsx | 5 |
3 files changed, 12 insertions, 11 deletions
diff --git a/packages/bank-ui/src/pages/PublicHistoriesPage.tsx b/packages/bank-ui/src/pages/PublicHistoriesPage.tsx index 554da0c3f..1810bd5dd 100644 --- a/packages/bank-ui/src/pages/PublicHistoriesPage.tsx +++ b/packages/bank-ui/src/pages/PublicHistoriesPage.tsx @@ -31,9 +31,9 @@ export function PublicHistoriesPage(): VNode { const result = usePublicAccounts(undefined); const firstAccount = result && - !(result instanceof TalerError) && - result.data.public_accounts.length > 0 - ? result.data.public_accounts[0].username + !(result instanceof TalerError) && + result.body.length > 0 + ? result.body[0].username : undefined; const [showAccount, setShowAccount] = useState(firstAccount); @@ -45,13 +45,13 @@ export function PublicHistoriesPage(): VNode { return <Loading />; } - const { data } = result; + const { body: accountList } = result; const txs: Record<string, h.JSX.Element> = {}; const accountsBar = []; // Ask story of all the public accounts. - for (const account of data.public_accounts) { + for (const account of accountList) { const isSelected = account.username == showAccount; accountsBar.push( <li diff --git a/packages/bank-ui/src/pages/admin/AccountList.tsx b/packages/bank-ui/src/pages/admin/AccountList.tsx index c4e529f9f..6402c2bcd 100644 --- a/packages/bank-ui/src/pages/admin/AccountList.tsx +++ b/packages/bank-ui/src/pages/admin/AccountList.tsx @@ -51,19 +51,19 @@ export function AccountList({ if (result instanceof TalerError) { return <ErrorLoadingWithDebug error={result} />; } - if (result.data.type === "fail") { - switch (result.data.case) { + if (result.type === "fail") { + switch (result.case) { case HttpStatusCode.Unauthorized: return <Fragment />; default: - assertUnreachable(result.data.case); + assertUnreachable(result.case); } } const onGoStart = result.isFirstPage ? undefined : result.loadFirst; const onGoNext = result.isLastPage ? undefined : result.loadNext; - const accounts = result.result; + const accounts = result.body; return ( <Fragment> <div class="px-4 sm:px-6 lg:px-8 mt-8"> diff --git a/packages/bank-ui/src/pages/admin/AdminHome.tsx b/packages/bank-ui/src/pages/admin/AdminHome.tsx index 94b88dc89..4784fc73a 100644 --- a/packages/bank-ui/src/pages/admin/AdminHome.tsx +++ b/packages/bank-ui/src/pages/admin/AdminHome.tsx @@ -26,6 +26,7 @@ import { Attention, useTranslationContext } from "@gnu-taler/web-util/browser"; import { format, getDate, + getDaysInMonth, getHours, getMonth, getYear, @@ -127,8 +128,8 @@ export function getTimeframesForDate( }; case TalerCorebankApi.MonitorTimeframeParam.day: return { - current: getDate(sub(time, { days: 1 })), - previous: getDate(sub(time, { days: 2 })), + current: getDaysInMonth(sub(time, { days: 1 })), + previous: getDaysInMonth(sub(time, { days: 2 })), }; case TalerCorebankApi.MonitorTimeframeParam.month: return { |