From 603efbd073a2a9aa56f801fe57d13f060821b05d Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 8 Feb 2023 17:39:39 -0300
Subject: use request api from web-util

---
 packages/merchant-backoffice-ui/src/InstanceRoutes.tsx | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

(limited to 'packages/merchant-backoffice-ui/src/InstanceRoutes.tsx')

diff --git a/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx b/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx
index 56f223620..5929b031a 100644
--- a/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx
+++ b/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx
@@ -19,7 +19,10 @@
  * @author Sebastian Javier Marchano (sebasjm)
  */
 
-import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
+import {
+  useTranslationContext,
+  HttpError,
+} from "@gnu-taler/web-util/lib/index.browser";
 import { format } from "date-fns";
 import { Fragment, FunctionComponent, h, VNode } from "preact";
 import { Route, route, Router } from "preact-router";
@@ -28,7 +31,6 @@ import { Loading } from "./components/exception/loading.js";
 import { Menu, NotificationCard } from "./components/menu/index.js";
 import { useBackendContext } from "./context/backend.js";
 import { InstanceContextProvider } from "./context/instance.js";
-import { HttpError } from "./utils/request.js";
 import {
   useBackendDefaultToken,
   useBackendInstanceToken,
@@ -63,6 +65,7 @@ import InstanceUpdatePage, {
 import LoginPage from "./paths/login/index.js";
 import NotFoundPage from "./paths/notfound/index.js";
 import { Notification } from "./utils/types.js";
+import { MerchantBackend } from "./declaration.js";
 
 export enum InstancePaths {
   // details = '/',
@@ -157,7 +160,9 @@ export function InstanceRoutes({
   );
 
   function ServerErrorRedirectTo(to: InstancePaths | AdminPaths) {
-    return function ServerErrorRedirectToImpl(error: HttpError) {
+    return function ServerErrorRedirectToImpl(
+      error: HttpError<MerchantBackend.ErrorDetail>,
+    ) {
       setGlobalNotification({
         message: i18n.str`The backend reported a problem: HTTP status #${error.status}`,
         description: i18n.str`Diagnostic from ${error.info?.url} is "${error.message}"`,
@@ -551,7 +556,7 @@ function AdminInstanceUpdatePage({
 }: { id: string } & InstanceUpdatePageProps): VNode {
   const [token, changeToken] = useBackendInstanceToken(id);
   const { updateLoginStatus: changeBackend } = useBackendContext();
-  const updateLoginStatus = (url: string, token?: string) => {
+  const updateLoginStatus = (url: string, token?: string): void => {
     changeBackend(url);
     if (token) changeToken(token);
   };
@@ -566,7 +571,7 @@ function AdminInstanceUpdatePage({
       <InstanceAdminUpdatePage
         {...rest}
         instanceId={id}
-        onLoadError={(error: HttpError) => {
+        onLoadError={(error: HttpError<MerchantBackend.ErrorDetail>) => {
           return (
             <Fragment>
               <NotificationCard
-- 
cgit v1.2.3

