taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit ff35b68f10d8982e40eabf828310bbf5af29df95
parent d612fb761b82a6e8a4690cd75d7605b4ca2ddd08
Author: Sebastian <sebasjm@gmail.com>
Date:   Mon,  3 Nov 2025 12:14:22 -0300

fix client response when the server doesnt have metrics

Diffstat:
Mpackages/taler-util/src/http-client/exchange-client.ts | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/packages/taler-util/src/http-client/exchange-client.ts b/packages/taler-util/src/http-client/exchange-client.ts @@ -54,6 +54,7 @@ import { AmlDecisionRequest, AmlDecisionsResponse, AvailableMeasureSummary, + EventCounter, ExchangeGetContractResponse, ExchangeKeysResponse, ExchangeKycUploadFormRequest, @@ -926,8 +927,9 @@ export class TalerExchangeHttpClient { switch (resp.status) { case HttpStatusCode.Ok: return opSuccessFromHttp(resp, codecForAmlStatisticsResponse()); - case HttpStatusCode.NoContent: - return opFixedSuccess({ statistics: [] }); + case HttpStatusCode.NoContent:{ + return opFixedSuccess({ statistics: names.map(name => ({counter: 0, name} as EventCounter)) }); + } case HttpStatusCode.Conflict: case HttpStatusCode.NotFound: case HttpStatusCode.Forbidden: