From 53af8b486fd8a538c1f54a2ce66ed5f74b2b46ed Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 10 Feb 2023 09:50:54 -0300 Subject: fix: request error is whats being thrown --- packages/merchant-backoffice-ui/src/hooks/transfer.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/hooks/transfer.ts') diff --git a/packages/merchant-backoffice-ui/src/hooks/transfer.ts b/packages/merchant-backoffice-ui/src/hooks/transfer.ts index 6b30047e9..0f9d79f24 100644 --- a/packages/merchant-backoffice-ui/src/hooks/transfer.ts +++ b/packages/merchant-backoffice-ui/src/hooks/transfer.ts @@ -13,16 +13,16 @@ You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see */ -import { useEffect, useState } from "preact/hooks"; -import useSWR from "swr"; -import { MerchantBackend } from "../declaration.js"; -import { MAX_RESULT_SIZE, PAGE_SIZE } from "../utils/constants.js"; import { - HttpError, HttpResponse, HttpResponseOk, HttpResponsePaginated, + RequestError, } from "@gnu-taler/web-util/lib/index.browser"; +import { useEffect, useState } from "preact/hooks"; +import useSWR from "swr"; +import { MerchantBackend } from "../declaration.js"; +import { MAX_RESULT_SIZE, PAGE_SIZE } from "../utils/constants.js"; import { useBackendInstanceRequest, useMatchMutate } from "./backend.js"; export function useTransferAPI(): TransferAPI { @@ -91,7 +91,7 @@ export function useInstanceTransfers( isValidating: loadingBefore, } = useSWR< HttpResponseOk, - HttpError + RequestError >( [ `/private/transfers`, @@ -108,7 +108,7 @@ export function useInstanceTransfers( isValidating: loadingAfter, } = useSWR< HttpResponseOk, - HttpError + RequestError >( [ `/private/transfers`, @@ -138,8 +138,8 @@ export function useInstanceTransfers( if (beforeData) setLastBefore(beforeData); }, [afterData, beforeData]); - if (beforeError) return beforeError; - if (afterError) return afterError; + if (beforeError) return beforeError.info; + if (afterError) return afterError.info; // if the query returns less that we ask, then we have reach the end or beginning const isReachingEnd = -- cgit v1.2.3