diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/transfers')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/transfers/create/index.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/index.tsx index e640e47f6..ac1d692a4 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/index.tsx @@ -20,14 +20,14 @@ */ 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 { useInstanceBankAccounts } from "../../../../hooks/bank.js"; -import { useTransferAPI } from "../../../../hooks/transfer.js"; import { Notification } from "../../../../utils/types.js"; import { CreatePage } from "./CreatePage.js"; +import { useSessionContext } from "../../../../context/session.js"; export type Entity = TalerMerchantApi.TransferInformation; interface Props { @@ -36,7 +36,8 @@ interface Props { } export default function CreateTransfer({ onConfirm, onBack }: Props): VNode { - const { informTransfer } = useTransferAPI(); + const { lib } = useMerchantApiContext(); + const { state } = useSessionContext(); const [notif, setNotif] = useState<Notification | undefined>(undefined); const { i18n } = useTranslationContext(); const instance = useInstanceBankAccounts(); @@ -51,7 +52,7 @@ export default function CreateTransfer({ onConfirm, onBack }: Props): VNode { onBack={onBack} accounts={accounts} onCreate={(request: TalerMerchantApi.TransferInformation) => { - return informTransfer(request) + return lib.management.informWireTransfer(state.token, request) .then(() => onConfirm()) .catch((error) => { setNotif({ |