Beispiel #1
0
        public async Task <IActionResult> CreateProject([FromBody] string projectName)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var email = User.Identity.Name;

            var project = await _db.CreateProject(email, projectName);

            if (project == null)
            {
                return(BadRequest("Wrong information!"));
            }

            return(Ok(project.GetDTO(ProjectUserRole.ProjectManager)));
        }