예제 #1
0
            public HttpResponseMessage Delete(int id)
            {
                _projectService.Delete(id);
                SuccessResponse response = new SuccessResponse();

                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
예제 #2
0
        public async Task <Response> Delete(Guid projectId, ClaimsPrincipal claims)
        {
            var result = await _service.Delete(projectId, claims.GetUserId());

            // await BroadcastChanges(result, ChangesType.Deleted);
            return(result);
        }
예제 #3
0
        public IActionResult Delete(int id)
        {
            if (_projectsService.GetById(id) == null)
            {
                return(NotFound());
            }

            _projectsService.Delete(id);

            return(Ok());
        }
        public async Task <IActionResult> Delete(Guid projectId)
        {
            var id = User.Claims.Where(c => c.Type == "Id").Select(c => c.Value).SingleOrDefault();

            if (String.IsNullOrEmpty(id))
            {
                return(Unauthorized());
            }
            Guid actorId = new Guid(id);

            try
            {
                await _projectsService.Delete(projectId, actorId);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
예제 #5
0
        public async Task <IHttpActionResult> Delete(int id)
        {
            if (id < 1)
            {
                return(BadRequest());
            }

            try
            {
                await _projectsService.Delete(id, GetUserAndOrganization());

                return(Ok());
            }
            catch (ValidationException e)
            {
                return(BadRequestWithError(e));
            }
            catch (UnauthorizedException)
            {
                return(Forbidden());
            }
        }
예제 #6
0
        public async Task <IActionResult> Delete(Project model)
        {
            await _projectService.Delete(model);

            return(RedirectToAction("Get"));
        }
예제 #7
0
        public async Task <IActionResult> Delete(Project model)
        {
            await _projectService.Delete(model);

            return(Ok(model));
        }
예제 #8
0
        public IActionResult Delete(int id)
        {
            _projectsService.Delete(id);

            return(RedirectToAction(nameof(ProjectsController.Index), "Projects"));
        }
예제 #9
0
 public ActionResult Delete(int projectId)
 {
     _projectsService.Delete(projectId);
     return(RedirectToAction("Index"));
 }