1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-23 13:46:45 +02:00

correctly add the type

This commit is contained in:
Thomas Heartman 2025-07-16 11:25:11 +02:00
parent 6a595a853c
commit 7988abdeef

View File

@ -27,7 +27,10 @@ import { CLIENT_METRICS } from '../../../events/index.js';
import type { CustomMetricsSchema } from '../../../openapi/spec/custom-metrics-schema.js'; import type { CustomMetricsSchema } from '../../../openapi/spec/custom-metrics-schema.js';
import type { StoredCustomMetric } from '../custom/custom-metrics-store.js'; import type { StoredCustomMetric } from '../custom/custom-metrics-store.js';
import type { CustomMetricsService } from '../custom/custom-metrics-service.js'; import type { CustomMetricsService } from '../custom/custom-metrics-service.js';
import type { MetricsTranslator } from '../impact/metrics-translator.js'; import type {
Metric,
MetricsTranslator,
} from '../impact/metrics-translator.js';
import type { ClientMetricsSchema } from '../../../server-impl.js'; import type { ClientMetricsSchema } from '../../../server-impl.js';
export default class ClientMetricsController extends Controller { export default class ClientMetricsController extends Controller {
@ -149,7 +152,7 @@ export default class ClientMetricsController extends Controller {
} }
async registerMetrics( async registerMetrics(
req: IAuthRequest<ClientMetricsSchema>, req: IAuthRequest<void, void, ClientMetricsSchema>,
res: Response, res: Response,
): Promise<void> { ): Promise<void> {
if (this.config.flagResolver.isEnabled('disableMetrics')) { if (this.config.flagResolver.isEnabled('disableMetrics')) {
@ -173,7 +176,9 @@ export default class ClientMetricsController extends Controller {
this.flagResolver.isEnabled('impactMetrics') && this.flagResolver.isEnabled('impactMetrics') &&
impactMetrics impactMetrics
) { ) {
await this.metricsV2.registerImpactMetrics(impactMetrics); await this.metricsV2.registerImpactMetrics(
impactMetrics as Metric[],
);
} }
res.getHeaderNames().forEach((header) => res.getHeaderNames().forEach((header) =>