diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs index c6e921a9f..3fc132fd4 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs @@ -113,16 +113,16 @@ namespace Orchard.Blogs.Controllers { } [HttpPost] - public ActionResult Remove(string blogSlug) { + public ActionResult Remove(int id) { if (!Services.Authorizer.Authorize(Permissions.ManageBlogs, T("Couldn't delete blog"))) return new HttpUnauthorizedResult(); - BlogPart blogPart = _blogService.Get(blogSlug); + var blog = _blogService.Get(id, VersionOptions.Latest); - if (blogPart == null) + if (blog == null) return HttpNotFound(); - _blogService.Delete(blogPart); + _blogService.Delete(blog); Services.Notifier.Information(T("Blog was successfully deleted")); return Redirect(Url.BlogsForAdmin()); diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs index 55d31cb0e..5e127be94 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs @@ -35,9 +35,9 @@ namespace Orchard.Blogs.Services { .List(); } - public void Delete(BlogPart blogPart) { - _contentManager.Remove(blogPart.ContentItem); - _blogSlugConstraint.RemoveSlug(blogPart.As().Path); + public void Delete(ContentItem blog) { + _contentManager.Remove(blog); + _blogSlugConstraint.RemoveSlug(blog.As().Path); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Services/IBlogService.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Services/IBlogService.cs index e944f5030..aa3242d15 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Services/IBlogService.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Services/IBlogService.cs @@ -7,6 +7,6 @@ namespace Orchard.Blogs.Services { BlogPart Get(string slug); ContentItem Get(int id, VersionOptions versionOptions); IEnumerable Get(); - void Delete(BlogPart blogPart); + void Delete(ContentItem blog); } } \ No newline at end of file