using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using isnd.Helpers;
using System.ComponentModel.DataAnnotations;
using isnd.Attributes;
namespace isnd.Controllers
{
    public partial class PackagesController
    {
        [HttpDelete(_pkgRootPrefix + ApiConfig.Delete + "/{id}/{*lower}")]
        public async Task<IActionResult> Delete(
           [FromRoute][SafeName][Required] string id, 
           [FromRoute][SafeName][Required] string lower)
        {
            string pkgtype = ParamHelpers.Optional(ref lower);
            var report = await _packageManager.DeletePackageAsync(id, lower, pkgtype);
            return Ok(report);
        }
    }
}
