diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/products')
3 files changed, 8 insertions, 10 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx index e1e3c846a..9de5cae78 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/create/index.tsx @@ -20,13 +20,13 @@ */ import { TalerMerchantApi } from "@gnu-taler/taler-util"; -import { useMerchantApiContext, useTranslationContext } from "@gnu-taler/web-util/browser"; -import { Fragment, h, VNode } from "preact"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; +import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { NotificationCard } from "../../../../components/menu/index.js"; +import { useSessionContext } from "../../../../context/session.js"; import { Notification } from "../../../../utils/types.js"; import { CreatePage } from "./CreatePage.js"; -import { useSessionContext } from "../../../../context/session.js"; export type Entity = TalerMerchantApi.ProductAddDetail; interface Props { @@ -34,7 +34,7 @@ interface Props { onConfirm: () => void; } export default function CreateProduct({ onConfirm, onBack }: Props): VNode { - const { lib } = useMerchantApiContext(); + const { lib } = useSessionContext(); const { state } = useSessionContext(); const [notif, setNotif] = useState<Notification | undefined>(undefined); const { i18n } = useTranslationContext(); diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx index db6cf5376..6ad0d4598 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/list/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 { VNode, h } from "preact"; @@ -36,9 +35,9 @@ import { useInstanceProducts } from "../../../../hooks/product.js"; import { Notification } from "../../../../utils/types.js"; +import { LoginPage } from "../../../login/index.js"; import { NotFoundPageOrAdminCreate } from "../../../notfound/index.js"; import { CardTable } from "./Table.js"; -import { LoginPage } from "../../../login/index.js"; interface Props { onCreate: () => void; @@ -49,7 +48,7 @@ export default function ProductList({ onSelect, }: Props): VNode { const result = useInstanceProducts(); - const { lib } = useMerchantApiContext(); + const { lib } = useSessionContext(); const { state } = useSessionContext(); const [deleting, setDeleting] = useState<TalerMerchantApi.ProductDetail & WithId | null>(null); diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/update/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/update/index.tsx index 06f813b14..5e3e58d80 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/products/update/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/products/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"; @@ -32,9 +31,9 @@ import { NotificationCard } from "../../../../components/menu/index.js"; import { useSessionContext } from "../../../../context/session.js"; import { useProductDetails } from "../../../../hooks/product.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.ProductAddDetail; interface Props { @@ -49,7 +48,7 @@ export default function UpdateProduct({ }: Props): VNode { const result = useProductDetails(pid); const [notif, setNotif] = useState<Notification | undefined>(undefined); - const { lib } = useMerchantApiContext(); + const { lib } = useSessionContext(); const { state } = useSessionContext(); const { i18n } = useTranslationContext(); |