From 7268c6786d191c3ffa9f98e0dede3500a9797db7 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 15 Oct 2015 15:42:46 +0200 Subject: [PATCH] manual merge back in the temporary DeleteContainerById method --- .../Editors/ContentTypeController.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index 9568a39678..15b80eaa75 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -111,6 +111,33 @@ namespace Umbraco.Web.Editors }; } + /// + /// Deletes a document type container wth a given ID + /// + /// + /// + [HttpDelete] + [HttpPost] + public HttpResponseMessage DeleteContainerById(int id) + { + //TODO: This needs to be implemented correctly + + var foundType = Services.EntityService.Get(id); + if (foundType == null) + { + throw new HttpResponseException(HttpStatusCode.NotFound); + } + + if (foundType.HasChildren()) + { + throw new HttpResponseException(HttpStatusCode.Forbidden); + } + + //TODO: what service to use to delete? + + return Request.CreateResponse(HttpStatusCode.OK); + } + public HttpResponseMessage PostCreateFolder(int parentId, string name) { var result = Services.ContentTypeService.CreateFolder(parentId, name, Security.CurrentUser.Id);