예제 #1
0
 public async Task <IActionResult> GetBansForKey(string key, [FromQuery] bool onlyActive, [FromQuery] int?source)
 {
     if (key == null || string.IsNullOrWhiteSpace(key))
     {
         return(BadRequest("Key cannot be empty or null"));
     }
     return(Ok(await _banService.GetBansForKeyAsync(key, source, onlyActive)));
 }
예제 #2
0
        public async Task <IActionResult> ViewBans(string key, bool onlyActive = false)
        {
            var bans = await _banService.GetBansForKeyAsync(key, null, onlyActive);

            return(View(new BanViewViewModel()
            {
                CKey = KeyUtilities.GetCanonicalKey(key), Bans = bans, OnlyActive = onlyActive
            }));
        }