public async Task Invoke(HttpContext context) { if (context.Items.ContainsKey("BAN")) { context.Items.Remove("BAN"); await blacklistService.AddBlacklist(new Blacklist { Ip = context.Request.Host.Host, Createtime = DateTime.Now }); context.Response.StatusCode = 409; } else { await next(context); } }
public async Task <IActionResult> AddBlacklist([FromForm] int pengajuanId, [FromForm] string keterangan) { return(Ok(await _service.AddBlacklist(pengajuanId, keterangan))); }