mirror of
https://github.com/g3rv4/FakeRelay.git
synced 2024-11-08 00:34:22 +01:00
tweaks
This commit is contained in:
parent
95d72cf0bd
commit
742d8eed11
@ -59,12 +59,12 @@ public class ApiController : Controller
|
|||||||
[Route("index-posts-count")]
|
[Route("index-posts-count")]
|
||||||
public async Task<ActionResult> IndexedPostsCount(string period)
|
public async Task<ActionResult> IndexedPostsCount(string period)
|
||||||
{
|
{
|
||||||
if (Config.Instance.GrafanaHost.IsNullOrEmpty() || Config.Instance.GrafanaKey.IsNullOrEmpty())
|
if (Config.Instance.GrafanaHost.IsNullOrEmpty() || Config.Instance.GrafanaKey.IsNullOrEmpty() || !Config.Instance.GrafanaDataSourceId.HasValue)
|
||||||
{
|
{
|
||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Regex.IsMatch(period, "^[0-9]+[mhd]$"))
|
if (period.IsNullOrEmpty() || !Regex.IsMatch(period, "^[0-9]+[mhd]$"))
|
||||||
{
|
{
|
||||||
return BadRequest();
|
return BadRequest();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user