aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-10-16 16:02:12 +0200
committerFlorian Dold <florian@dold.me>2023-10-16 16:02:12 +0200
commitaca3bc9423f15354913d0114cafbd4bd1782d801 (patch)
tree87fb37881edb20196e36bd31230584b385808ebc /packages/taler-util
parent925a97c2e3a52222cb28b2b64d80c0b01305defe (diff)
-fix transaction query parsing
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/transactions-types.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/taler-util/src/transactions-types.ts b/packages/taler-util/src/transactions-types.ts
index 083124afa..88830d82b 100644
--- a/packages/taler-util/src/transactions-types.ts
+++ b/packages/taler-util/src/transactions-types.ts
@@ -43,6 +43,8 @@ import {
codecForList,
codecForAny,
codecForBoolean,
+ codecForEither,
+ codecForConstString,
} from "./codec.js";
import {
RefreshReason,
@@ -697,6 +699,15 @@ export const codecForTransactionsRequest = (): Codec<TransactionsRequest> =>
buildCodecForObject<TransactionsRequest>()
.property("currency", codecOptional(codecForString()))
.property("search", codecOptional(codecForString()))
+ .property(
+ "sort",
+ codecOptional(
+ codecForEither(
+ codecForConstString("ascending"),
+ codecForConstString("descending"),
+ ),
+ ),
+ )
.property("includeRefreshes", codecOptional(codecForBoolean()))
.build("TransactionsRequest");