aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-06-03 12:42:53 -0300
committerSebastian <sebasjm@gmail.com>2024-06-03 12:42:53 -0300
commit228324bb4411515675930e68eece2045dcafe12a (patch)
tree7cbd92c31a7721603185d5877040899b96ecef84 /packages
parent43857ec597880cbb4d8c6e477fab192b827b962f (diff)
downloadwallet-core-228324bb4411515675930e68eece2045dcafe12a.tar.xz
support noContent
Diffstat (limited to 'packages')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx41
-rw-r--r--packages/taler-util/src/http-client/bank-revenue.ts4
-rw-r--r--packages/web-util/src/components/CopyButton.tsx2
3 files changed, 6 insertions, 41 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx
index fa86271c3..4849d1d6c 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx
@@ -73,7 +73,7 @@ export default function CreateValidator({ onConfirm, onBack }: Props): VNode {
message: i18n.str`Could not create account`,
type: "ERROR",
description: i18n.str`The request to check the revenue API failed.`,
- details: resp.errorDetail
+ details: JSON.stringify(resp.errorDetail, undefined, 2),
});
return;
}
@@ -166,51 +166,12 @@ export async function testRevenueAPI(
if (config.type === "fail") {
return config;
- // switch (config.case) {
- // case HttpStatusCode.Unauthorized: {
- // return {
- // type: "fail",
- // case: TestRevenueErrorType.UNAUTHORIZED,
- // detail: config.detail,
- // };
- // }
- // case HttpStatusCode.NotFound: {
- // return {
- // type: "fail",
- // case: TestRevenueErrorType.NO_CONFIG,
- // detail: config.detail,
- // };
- // }
- // }
}
const history = await api.getHistory(auth);
if (history.type === "fail") {
return history;
- // switch (history.case) {
- // case HttpStatusCode.BadRequest: {
- // return {
- // type: "fail",
- // case: TestRevenueErrorType.CLIENT_BAD_REQUEST,
- // detail: history.detail,
- // };
- // }
- // case HttpStatusCode.Unauthorized: {
- // return {
- // type: "fail",
- // case: TestRevenueErrorType.UNAUTHORIZED,
- // detail: history.detail,
- // };
- // }
- // case HttpStatusCode.NotFound: {
- // return {
- // type: "fail",
- // case: TestRevenueErrorType.NOT_FOUND,
- // detail: history.detail,
- // };
- // }
- // }
}
} catch (err) {
if (err instanceof TalerError) {
diff --git a/packages/taler-util/src/http-client/bank-revenue.ts b/packages/taler-util/src/http-client/bank-revenue.ts
index 34afe7d86..8331856a9 100644
--- a/packages/taler-util/src/http-client/bank-revenue.ts
+++ b/packages/taler-util/src/http-client/bank-revenue.ts
@@ -25,6 +25,7 @@ import { LibtoolVersion } from "../libtool-version.js";
import {
FailCasesByMethod,
ResultByMethod,
+ opFixedSuccess,
opKnownHttpFailure,
opSuccessFromHttp,
opUnknownFailure,
@@ -117,6 +118,9 @@ export class TalerRevenueHttpClient {
switch (resp.status) {
case HttpStatusCode.Ok:
return opSuccessFromHttp(resp, codecForRevenueIncomingHistory());
+ // FIXME: missing in docs
+ case HttpStatusCode.NoContent:
+ return opFixedSuccess({incoming_transactions: [], credit_account: "" });
case HttpStatusCode.BadRequest:
return opKnownHttpFailure(resp.status, resp);
case HttpStatusCode.Unauthorized:
diff --git a/packages/web-util/src/components/CopyButton.tsx b/packages/web-util/src/components/CopyButton.tsx
index dbb38b474..3ca3e4078 100644
--- a/packages/web-util/src/components/CopyButton.tsx
+++ b/packages/web-util/src/components/CopyButton.tsx
@@ -21,7 +21,7 @@ export function CopyButton({ class: clazz, children, getContent }: { children?:
const [copied, setCopied] = useState(false);
function copyText(): void {
if (!navigator.clipboard && !window.isSecureContext) {
- alert('clipboard is not available on insecure context (http)')
+ alert(`clipboard is not available on insecure context (http), the content is:\n${getContent()}`)
}
if (navigator.clipboard) {
navigator.clipboard.writeText(getContent() || "");