diff --git a/src/Umbraco.Web/Editors/PackageController.cs b/src/Umbraco.Web/Editors/PackageController.cs index 6d4655f0be..d192ee21f3 100644 --- a/src/Umbraco.Web/Editors/PackageController.cs +++ b/src/Umbraco.Web/Editors/PackageController.cs @@ -8,6 +8,8 @@ using Umbraco.Web.WebApi.Filters; namespace Umbraco.Web.Editors { + //TODO: Packager stuff still lives in business logic - YUK + /// /// A controller used for installing packages and managing all of the data in the packages section in the back office /// @@ -18,23 +20,8 @@ namespace Umbraco.Web.Editors [HttpGet] public List GetCreatedPackages() { - //TODO: Packager stuff still lives in business logic - YUK //TODO: Could be too much data down the wire return CreatedPackage.GetAllCreatedPackages(); - - /* - * "author": "Test", - "files": [], - "iconUrl": "", - "id": 1, - "license": "MIT License", - "licenseUrl": "http://opensource.org/licenses/MIT", - "name": "Test v8", - "url": "https://test.com", - "version": "0.0.0" - */ - - } [HttpGet] @@ -43,6 +30,23 @@ namespace Umbraco.Web.Editors return CreatedPackage.GetById(id); } + [HttpPost] + public CreatedPackage PostCreatePackage(PackageInstance model) + { + //TODO Validation on the model?! + var newPackage = new CreatedPackage + { + Data = model + }; + + //Save then publish + newPackage.Save(); + newPackage.Publish(); + + //We should have packagepath populated now + return newPackage; + } + [HttpDelete] public HttpResponseMessage DeleteCreatedPackageById(int id) {