aboutsummaryrefslogtreecommitdiff
path: root/packages/aml-backoffice-ui/src/hooks
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-02-21 16:15:55 -0300
committerSebastian <sebasjm@gmail.com>2024-02-21 16:15:55 -0300
commit750700a45b01060bd3a26a6769e03844aaddb334 (patch)
treef16e323787b4caad69c1f4e8df0a2e77dc63b181 /packages/aml-backoffice-ui/src/hooks
parentf5b14b774e3c7f4e240082fac00b1be0a622b096 (diff)
fix #8462
Diffstat (limited to 'packages/aml-backoffice-ui/src/hooks')
-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;