order chat context messages from oldest to newest

This commit is contained in:
RaidMax 2022-01-25 14:24:27 -06:00
parent 686b297d32
commit e4cb3abb20

View File

@ -91,14 +91,15 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
var whenUpper = whenTime.AddMinutes(5);
var whenLower = whenTime.AddMinutes(-5);
var messages = await _chatResourceQueryHelper.QueryResource(new ChatSearchQuery()
var messages = await _chatResourceQueryHelper.QueryResource(new ChatSearchQuery
{
ServerId = serverId,
SentBefore = whenUpper,
SentAfter = whenLower
});
return View("~/Views/Client/_MessageContext.cshtml", messages.Results.ToList());
return View("~/Views/Client/_MessageContext.cshtml",
messages.Results.OrderBy(message => message.When).ToList());
}
[HttpGet("Message/Find")]
@ -212,4 +213,4 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
}
}
}
}
}