-fix transaction query parsing

This commit is contained in:
Florian Dold 2023-10-16 16:02:12 +02:00
parent 925a97c2e3
commit aca3bc9423
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -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");