From aca3bc9423f15354913d0114cafbd4bd1782d801 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 16 Oct 2023 16:02:12 +0200 Subject: [PATCH] -fix transaction query parsing --- packages/taler-util/src/transactions-types.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 => buildCodecForObject() .property("currency", codecOptional(codecForString())) .property("search", codecOptional(codecForString())) + .property( + "sort", + codecOptional( + codecForEither( + codecForConstString("ascending"), + codecForConstString("descending"), + ), + ), + ) .property("includeRefreshes", codecOptional(codecForBoolean())) .build("TransactionsRequest");