예제 #1
0
        public async Task <ProjectAboutResponse> PutAsync(long id, [FromBody] UpdateProjectRequest request)
        {
            if (!await _projectService.IsAuthorizedToEditProjectAsync(id, User.GetUserId()))
            {
                throw new AppErrorException(ErrorCode.UserNotAuthor);
            }

            var project = await _projectService.UpdateAsync(id, request);

            return(ProjectAboutResponse.Create(project));
        }
예제 #2
0
        public async Task <ProjectAboutResponse> PostAsync([FromBody] CreateProjectRequest request)
        {
            var project = await _projectService.CreateAsync(User.GetUserId(), request);

            return(ProjectAboutResponse.Create(project));
        }
예제 #3
0
        public async Task <ProjectAboutResponse> GetAboutAsync(long id)
        {
            var project = await _projectService.GetByIdAsync(id);

            return(ProjectAboutResponse.Create(project));
        }