public async Task <List <ScheduledTaskModel> > GetScheduledTasks(ScheduledTasksQueryModel model, int userId) { var fromDate = CustomFormatExtensions.TryDateFormatter(model.FromDate); var toDate = CustomFormatExtensions.TryDateFormatter(model.ToDate); var results = await _queries.GetScheduledTasks(fromDate, toDate, userId); return(results); }
public async Task <IActionResult> GetScheduledTasks([FromBody] ScheduledTasksQueryModel model) { var userId = _userManagerService.TryGetUserId(User); if (!userId.HasValue) { return(new UnauthorizedResult()); } var results = await _tasksService.GetScheduledTasks(model, userId.Value); return(Ok(results)); }