Exemplo n.º 1
0
        public async Task <IActionResult> CreateScare([FromBody] CreateScareRequest request)
        {
            if (ModelState.IsValid)
            {
                return(ProcessRequest <Scare>(await _api.CreateScareAsync(request, PrimitiveMapperHelper.Map(User.Claims)).ConfigureAwait(false)));
            }

            return(BadRequest(ModelState.Values.SelectMany(v => v.Errors)));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetDailyWork(DateTime?dateFrom, DateTime?dateTo = null, bool filterByAccomplished = false)
        {
            var request = new DailyWorkRequest()
            {
                From = dateFrom.Value,
                To   = dateTo.Value,
                FilterByAccomplishedGoal = filterByAccomplished
            };

            return(ProcessRequest <DailyWorkResponse>(await _api.GetWorkAsync(request, PrimitiveMapperHelper.Map(User.Claims)).ConfigureAwait(false)));
        }