예제 #1
0
 public IActionResult Create([FromRoute] Guid project_id, [FromBody] TaskSprintCreateM model)
 {
     try
     {
         JwtClaimM jwt_claim = _jwtAuth.GetClaims(Request);
         _permission.EnsureProjectManager(jwt_claim.UserId, project_id);
         Guid sprint_id;
         if (model.SprintId == null)
         {
             sprint_id = _sprint.Add(project_id, model.StartDate, model.EndDate, model.Approvals);
         }
         else
         {
             sprint_id = model.SprintId.Value;
         }
         return(Created("", _task.AddMany(project_id, sprint_id, model)));
     }
     catch (Exception e)
     {
         return(GetError(e));
     }
 }