-fix schema validation

This commit is contained in:
Florian Dold 2023-02-14 13:10:38 +01:00
parent 55f868d5e8
commit e3bdfe61a8
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,7 @@ import {
codecForString, codecForString,
codecForList, codecForList,
codecForAny, codecForAny,
codecForBoolean,
} from "./codec.js"; } from "./codec.js";
import { import {
RefreshReason, RefreshReason,
@ -586,6 +587,7 @@ export const codecForTransactionsRequest = (): Codec<TransactionsRequest> =>
buildCodecForObject<TransactionsRequest>() buildCodecForObject<TransactionsRequest>()
.property("currency", codecOptional(codecForString())) .property("currency", codecOptional(codecForString()))
.property("search", codecOptional(codecForString())) .property("search", codecOptional(codecForString()))
.property("includeRefreshes", codecOptional(codecForBoolean()))
.build("TransactionsRequest"); .build("TransactionsRequest");
// FIXME: do full validation here! // FIXME: do full validation here!

View File

@ -24,6 +24,7 @@ import {
constructPayPullUri, constructPayPullUri,
constructPayPushUri, constructPayPushUri,
ExtendedStatus, ExtendedStatus,
j2s,
Logger, Logger,
OrderShortInfo, OrderShortInfo,
PaymentStatus, PaymentStatus,
@ -958,6 +959,8 @@ export async function getTransactions(
transactions.push(buildTransactionForPullPaymentDebit(pi)); transactions.push(buildTransactionForPullPaymentDebit(pi));
}); });
logger.info(`tx request: ${j2s(transactionsRequest)}`);
if (transactionsRequest?.includeRefreshes) { if (transactionsRequest?.includeRefreshes) {
tx.refreshGroups.iter().forEachAsync(async (rg) => { tx.refreshGroups.iter().forEachAsync(async (rg) => {
if (shouldSkipCurrency(transactionsRequest, rg.currency)) { if (shouldSkipCurrency(transactionsRequest, rg.currency)) {