public async Task <IActionResult> ClearCallsCount([FromBody] CallsCountRequest model) { try { var tasks = new List <Task> { _callTimeLimitsService.ClearCallsHistoryAsync(model.Operation, model.ClientId) }; if (model.Operation == ConfirmOperations.Google2FaSmsConfirm) { tasks.Add(_blacklistService.ResetAsyncAsync(model.ClientId)); } await Task.WhenAll(tasks); return(Ok()); } catch (Exception exception) { _log.Error(exception, context: new { model.ClientId }); throw; } }
public async Task <IActionResult> GetCallsCount([FromBody] CallsCountRequest model) { try { int callsCount = await _callTimeLimitsService.GetCallsCountAsync(model.Operation, model.ClientId); return(Ok(new CallsCountResponse { Count = callsCount })); } catch (Exception exception) { _log.Error(exception, context: new { model.ClientId }); throw; } }