diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/accounts/create')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx index b12b95f2f..35c9e6624 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx @@ -20,13 +20,13 @@ */ import { TalerMerchantApi } from "@gnu-taler/taler-util"; -import { useTranslationContext } from "@gnu-taler/web-util/browser"; +import { useMerchantApiContext, useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { NotificationCard } from "../../../../components/menu/index.js"; -import { useBankAccountAPI } from "../../../../hooks/bank.js"; import { Notification } from "../../../../utils/types.js"; import { CreatePage } from "./CreatePage.js"; +import { useSessionContext } from "../../../../context/session.js"; export type Entity = TalerMerchantApi.AccountAddDetails; interface Props { @@ -35,7 +35,8 @@ interface Props { } export default function CreateValidator({ onConfirm, onBack }: Props): VNode { - const { createBankAccount } = useBankAccountAPI(); + const { lib: api } = useMerchantApiContext(); + const { state } = useSessionContext(); const [notif, setNotif] = useState<Notification | undefined>(undefined); const { i18n } = useTranslationContext(); @@ -45,7 +46,7 @@ export default function CreateValidator({ onConfirm, onBack }: Props): VNode { <CreatePage onBack={onBack} onCreate={(request: Entity) => { - return createBankAccount(request) + return api.management.addAccount(state.token, request) .then(() => { onConfirm() }) |