From 072ac43b9f69807b8514eb11f8214637561a2573 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Thu, 4 Apr 2024 16:24:55 -0300
Subject: fix some API differences including whatwg-url params

---
 .../src/paths/instance/templates/create/CreatePage.tsx            | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx')

diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx
index 82c0d0e53..2ba637f44 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx
@@ -28,6 +28,7 @@ import {
   assertUnreachable,
 } from "@gnu-taler/taler-util";
 import {
+  useMerchantApiContext,
   useTranslationContext
 } from "@gnu-taler/web-util/browser";
 import { VNode, h } from "preact";
@@ -44,7 +45,6 @@ import { InputNumber } from "../../../../components/form/InputNumber.js";
 import { InputSearchOnList } from "../../../../components/form/InputSearchOnList.js";
 import { InputTab } from "../../../../components/form/InputTab.js";
 import { InputWithAddon } from "../../../../components/form/InputWithAddon.js";
-import { useSessionContext } from "../../../../context/session.js";
 import { useInstanceOtpDevices } from "../../../../hooks/otp.js";
 
 enum Steps {
@@ -73,9 +73,7 @@ interface Props {
 
 export function CreatePage({ onCreate, onBack }: Props): VNode {
   const { i18n } = useTranslationContext();
-  const {
-    state: { backendUrl },
-  } = useSessionContext();
+  const { url: backendUrl } = useMerchantApiContext();
   const devices = useInstanceOtpDevices();
 
   const [state, setState] = useState<Partial<Entity>>({
@@ -201,7 +199,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode {
             >
               <InputWithAddon<Entity>
                 name="id"
-                help={new URL(`templates/${state.id ?? ""}`, backendUrl).href}
+                help={new URL(`templates/${state.id ?? ""}`, backendUrl.href).href}
                 label={i18n.str`Identifier`}
                 tooltip={i18n.str`Name of the template in URLs.`}
               />
-- 
cgit v1.2.3

