From 226af90698b993f3e4a4c6995836271f7f99a632 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Mon, 29 Nov 2021 20:30:24 -0700 Subject: [PATCH] fix for duplicated value --- Wabbajack.Server/Controllers/Metrics.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Wabbajack.Server/Controllers/Metrics.cs b/Wabbajack.Server/Controllers/Metrics.cs index e89fe366..59d31d42 100644 --- a/Wabbajack.Server/Controllers/Metrics.cs +++ b/Wabbajack.Server/Controllers/Metrics.cs @@ -64,21 +64,21 @@ public class MetricsController : ControllerBase } [HttpGet] - [Route("{action}/{subject}")] - public async Task LogMetricAsync(string action, string subject) + [Route("{subject}/{value}")] + public async Task LogMetricAsync(string subject, string value) { var date = DateTime.UtcNow; var metricsKey = Request.Headers[_settings.MetricsKeyHeader].FirstOrDefault(); // Used in tests - if (subject is "Default" or "untitled" || subject == "failed_download" || Guid.TryParse(subject, out _)) + if (value is "Default" or "untitled" || subject == "failed_download" || Guid.TryParse(value, out _)) return new Result {Timestamp = date}; await _metricsStore.Ingest(new Metric { Timestamp = DateTime.UtcNow, - Action = action, - Subject = subject, + Action = subject, + Subject = value, MetricsKey = metricsKey, UserAgent = Request.Headers.UserAgent.FirstOrDefault() ?? "", });