diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/templates/update')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx | 9 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/templates/update/index.tsx | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx index a4813c8e9..eedb77f28 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx @@ -28,8 +28,7 @@ import { TranslatedString, } from "@gnu-taler/taler-util"; import { - useMerchantApiContext, - useTranslationContext, + useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; @@ -45,6 +44,7 @@ import { InputNumber } from "../../../../components/form/InputNumber.js"; import { InputSelector } from "../../../../components/form/InputSelector.js"; import { InputToggle } from "../../../../components/form/InputToggle.js"; import { TextField } from "../../../../components/form/TextField.js"; +import { useSessionContext } from "../../../../context/session.js"; import { useInstanceOtpDevices } from "../../../../hooks/otp.js"; type Entity = { @@ -67,7 +67,8 @@ interface Props { export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { const { i18n } = useTranslationContext(); - const { url: backendUrl, config } = useMerchantApiContext(); + const { config } = useSessionContext(); + const {state:session} = useSessionContext(); const [state, setState] = useState<Partial<Entity>>({ description: template.template_description, @@ -176,7 +177,7 @@ export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { <div class="level-left"> <div class="level-item"> <span class="is-size-4"> - {new URL(`templates/${template.id}`, backendUrl.href).href} + {new URL(`templates/${template.id}`, session.backendUrl.href).href} </span> </div> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/update/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/update/index.tsx index 9e5099947..6185bd2a9 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/templates/update/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/templates/update/index.tsx @@ -21,7 +21,6 @@ import { HttpStatusCode, TalerError, TalerMerchantApi, assertUnreachable } from "@gnu-taler/taler-util"; import { - useMerchantApiContext, useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; @@ -34,9 +33,9 @@ import { useTemplateDetails, } from "../../../../hooks/templates.js"; import { Notification } from "../../../../utils/types.js"; +import { LoginPage } from "../../../login/index.js"; import { NotFoundPageOrAdminCreate } from "../../../notfound/index.js"; import { UpdatePage } from "./UpdatePage.js"; -import { LoginPage } from "../../../login/index.js"; export type Entity = TalerMerchantApi.TemplatePatchDetails & WithId; @@ -50,7 +49,7 @@ export default function UpdateTemplate({ onConfirm, onBack, }: Props): VNode { - const { lib } = useMerchantApiContext(); + const { lib } = useSessionContext(); const { state } = useSessionContext(); const result = useTemplateDetails(tid); const [notif, setNotif] = useState<Notification | undefined>(undefined); |