aboutsummaryrefslogtreecommitdiff
path: root/packages/aml-backoffice-ui
diff options
context:
space:
mode:
Diffstat (limited to 'packages/aml-backoffice-ui')
-rw-r--r--packages/aml-backoffice-ui/src/pages/CaseDetails.tsx8
-rw-r--r--packages/aml-backoffice-ui/src/pages/Cases.tsx9
-rw-r--r--packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx9
3 files changed, 15 insertions, 11 deletions
diff --git a/packages/aml-backoffice-ui/src/pages/CaseDetails.tsx b/packages/aml-backoffice-ui/src/pages/CaseDetails.tsx
index 7f33dcb90..3da3c21ea 100644
--- a/packages/aml-backoffice-ui/src/pages/CaseDetails.tsx
+++ b/packages/aml-backoffice-ui/src/pages/CaseDetails.tsx
@@ -2,6 +2,7 @@ import {
AbsoluteTime,
AmountJson,
Amounts,
+ HttpStatusCode,
TalerError,
TranslatedString,
assertUnreachable
@@ -126,9 +127,10 @@ export function CaseDetails({ account }: { account: string }) {
}
if (details.type === "fail") {
switch (details.case) {
- case "unauthorized":
- case "officer-not-found":
- case "officer-disabled": return <div />
+ case HttpStatusCode.Unauthorized:
+ case HttpStatusCode.Forbidden:
+ case HttpStatusCode.NotFound:
+ case HttpStatusCode.Conflict: return <div />
default: assertUnreachable(details)
}
}
diff --git a/packages/aml-backoffice-ui/src/pages/Cases.tsx b/packages/aml-backoffice-ui/src/pages/Cases.tsx
index 24f78f2d2..88580a4ce 100644
--- a/packages/aml-backoffice-ui/src/pages/Cases.tsx
+++ b/packages/aml-backoffice-ui/src/pages/Cases.tsx
@@ -1,4 +1,4 @@
-import { TalerError, TalerExchangeApi, TranslatedString, assertUnreachable } from "@gnu-taler/taler-util";
+import { HttpStatusCode, TalerError, TalerExchangeApi, TranslatedString, assertUnreachable } from "@gnu-taler/taler-util";
import { ErrorLoading, Loading, createNewForm, useTranslationContext } from "@gnu-taler/web-util/browser";
import { VNode, h } from "preact";
import { useState } from "preact/hooks";
@@ -167,9 +167,10 @@ export function Cases() {
if (list.data.type === "fail") {
switch (list.data.case) {
- case "unauthorized": return <Officer />
- case "officer-not-found": return <Officer />
- case "officer-disabled": return <Officer />
+ case HttpStatusCode.Unauthorized:
+ case HttpStatusCode.Forbidden:
+ case HttpStatusCode.NotFound:
+ case HttpStatusCode.Conflict: return <Officer />
default: assertUnreachable(list.data)
}
}
diff --git a/packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx b/packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx
index 4f9b909e0..ee31ed7a8 100644
--- a/packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx
+++ b/packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx
@@ -1,4 +1,4 @@
-import { Amounts, TalerExchangeApi, TalerProtocolTimestamp, TranslatedString } from "@gnu-taler/taler-util";
+import { Amounts, HttpStatusCode, TalerExchangeApi, TalerProtocolTimestamp, TranslatedString } from "@gnu-taler/taler-util";
import { LocalNotificationBanner, useLocalNotification, useTranslationContext } from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { useExchangeApiContext } from "../context/config.js";
@@ -54,19 +54,20 @@ export function NewFormEntry({
return;
}
switch (resp.case) {
- case "unauthorized": return notify({
+ case HttpStatusCode.Forbidden:
+ case HttpStatusCode.Unauthorized: return notify({
type: "error",
title: i18n.str`Wrong credentials for "${officer.account}"`,
description: resp.detail.hint as TranslatedString,
debug: resp.detail,
})
- case "officer-or-account-not-found": return notify({
+ case HttpStatusCode.NotFound: return notify({
type: "error",
title: i18n.str`Officer or account not found`,
description: resp.detail.hint as TranslatedString,
debug: resp.detail,
})
- case "officer-disabled-or-recent-decision": return notify({
+ case HttpStatusCode.Conflict: return notify({
type: "error",
title: i18n.str`Officer disabled or more recent decision was already submitted.`,
description: resp.detail.hint as TranslatedString,