summaryrefslogtreecommitdiff
path: root/packages/aml-backoffice-ui/src/hooks/useCases.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/aml-backoffice-ui/src/hooks/useCases.ts')
-rw-r--r--packages/aml-backoffice-ui/src/hooks/useCases.ts50
1 files changed, 2 insertions, 48 deletions
diff --git a/packages/aml-backoffice-ui/src/hooks/useCases.ts b/packages/aml-backoffice-ui/src/hooks/useCases.ts
index 1cd16a6f6..68deb7db9 100644
--- a/packages/aml-backoffice-ui/src/hooks/useCases.ts
+++ b/packages/aml-backoffice-ui/src/hooks/useCases.ts
@@ -1,7 +1,7 @@
import { useState } from "preact/hooks";
// FIX default import https://github.com/microsoft/TypeScript/issues/49189
-import { AmountString, OfficerAccount, OperationFail, TalerExchangeApi, TalerExchangeResultByMethod, TalerHttpError } from "@gnu-taler/taler-util";
+import { AmountString, HttpStatusCode, OfficerAccount, OperationFail, TalerExchangeApi, TalerExchangeResultByMethod, TalerHttpError } from "@gnu-taler/taler-util";
import _useSWR, { SWRHook } from "swr";
import { useExchangeApiContext } from "../context/config.js";
import { useOfficer } from "./useOfficer.js";
@@ -68,7 +68,7 @@ export function useCases(state: AmlExchangeBackend.AmlState) {
return {
data: {
type: "fail",
- case: "unauthorized",
+ case: HttpStatusCode.Unauthorized,
detail: {}
} as OperationFail<never>
}
@@ -87,52 +87,6 @@ export function useCases(state: AmlExchangeBackend.AmlState) {
return undefined;
}
-const example1: TalerExchangeApi.AmlRecords = {
- records: [
- {
- current_state: 0,
- h_payto: "QWEQWEQWEQWEWQE",
- rowid: 1,
- threshold: "USD 100" as AmountString,
- },
- {
- current_state: 1,
- h_payto: "ASDASDASD",
- rowid: 1,
- threshold: "USD 100" as AmountString,
- },
- {
- current_state: 2,
- h_payto: "ZXCZXCZXCXZC",
- rowid: 1,
- threshold: "USD 1000" as AmountString,
- },
- {
- current_state: 0,
- h_payto: "QWEQWEQWEQWEWQE",
- rowid: 1,
- threshold: "USD 100" as AmountString,
- },
- {
- current_state: 1,
- h_payto: "ASDASDASD",
- rowid: 1,
- threshold: "USD 100" as AmountString,
- },
- {
- current_state: 2,
- h_payto: "ZXCZXCZXCXZC",
- rowid: 1,
- threshold: "USD 1000" as AmountString,
- },
- ].map((e, idx) => {
- e.rowid = idx;
- e.threshold = `${e.threshold}${idx}` as AmountString;
- return e;
- }),
-};
-
-
function removeLastElement<T>(list: Array<T>): Array<T> {
if (list.length === 0) {
return list;