Ejemplo n.º 1
0
        public async Task <IActionResult> UpdateMyTasks(int id, [FromBody] List <TaskSignupViewModel> model)
        {
            var currentUser = await GetCurrentUserAsync();

            foreach (var taskSignup in model)
            {
                await _prepOpsDataAccess.UpdateTaskSignup(new TaskUsers {
                    Id = taskSignup.Id,
                    StatusDateTimeUtc = DateTime.UtcNow,
                    StatusDescription = taskSignup.StatusDescription,
                    Status            = taskSignup.Status,
                    Task = new PrepOpsTask {
                        Id = taskSignup.TaskId
                    },
                    User = currentUser
                });
            }
            var result = new {
                success = true
            };

            return(Json(result));
        }