aboutsummaryrefslogtreecommitdiff
path: root/packages/aml-backoffice-ui/src/hooks/decisions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/aml-backoffice-ui/src/hooks/decisions.ts')
-rw-r--r--packages/aml-backoffice-ui/src/hooks/decisions.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/aml-backoffice-ui/src/hooks/decisions.ts b/packages/aml-backoffice-ui/src/hooks/decisions.ts
index e652f233e..de8f1637e 100644
--- a/packages/aml-backoffice-ui/src/hooks/decisions.ts
+++ b/packages/aml-backoffice-ui/src/hooks/decisions.ts
@@ -37,7 +37,7 @@ export const PAGINATED_LIST_REQUEST = PAGINATED_LIST_SIZE + 1;
* @param args
* @returns
*/
-export function useCurrentDecisions() {
+export function useCurrentDecisions(filtered?: boolean) {
const officer = useOfficer();
const session = officer.state === "ready" ? officer.account : undefined;
const {
@@ -46,13 +46,15 @@ export function useCurrentDecisions() {
const [offset, setOffset] = useState<string>();
- async function fetcher([officer, offset]: [
+ async function fetcher([officer, offset, investigation]: [
OfficerAccount,
string | undefined,
+ boolean | undefined
]) {
return await api.getAmlDecisions(officer, {
- order: "asc",
+ order: "dec",
offset,
+ investigation,
active: true,
limit: PAGINATED_LIST_REQUEST,
});
@@ -62,7 +64,7 @@ export function useCurrentDecisions() {
TalerExchangeResultByMethod<"getAmlDecisions">,
TalerHttpError
>(
- !session ? undefined : [session, offset, "getAmlDecisions"],
+ !session ? undefined : [session, offset, filtered ? true : filtered, "getAmlDecisions"],
fetcher,
);
@@ -95,7 +97,7 @@ export function useAccountDecisions(accountStr: string) {
string | undefined,
]) {
return await api.getAmlDecisions(officer, {
- order: "asc",
+ order: "dec",
offset,
account,
limit: PAGINATED_LIST_REQUEST,