From 28ab1cd0c299c58cef42e0309069da34513bb95d Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Fri, 3 Nov 2023 11:00:19 +0100 Subject: [PATCH] fix: handle cost model conversion for epoch number as well --- src/routes/epochs/number/parameters.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/epochs/number/parameters.ts b/src/routes/epochs/number/parameters.ts index 645556a5..1142fd57 100644 --- a/src/routes/epochs/number/parameters.ts +++ b/src/routes/epochs/number/parameters.ts @@ -6,7 +6,7 @@ import * as QueryTypes from '../../../types/queries/epochs.js'; import * as ResponseTypes from '../../../types/responses/epochs.js'; import { getDbSync } from '../../../utils/database.js'; import { handle400Custom, handle404 } from '../../../utils/error-handler.js'; -import { sortKeysInObject } from '../../../utils/string-utils.js'; +import { costModelsMap } from '../../../utils/cost-models-map.js'; import { validatePositiveInRangeSignedInt } from '../../../utils/validation.js'; async function route(fastify: FastifyInstance) { @@ -36,7 +36,7 @@ async function route(fastify: FastifyInstance) { } if (rows[0].cost_models) { - rows[0].cost_models = sortKeysInObject(rows[0].cost_models); + rows[0].cost_models = costModelsMap(rows[0].cost_models); } return reply.send(rows[0]);