isn/src/isnd/Controllers/Packages/Delete.cs

21 lines
695 B
C#
Raw Normal View History

2021-09-05 15:44:47 +01:00
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using isnd.Helpers;
2022-04-17 16:22:40 +01:00
using isnd.Entities;
2021-09-05 15:44:47 +01:00
using System.ComponentModel.DataAnnotations;
2021-09-05 19:33:39 +01:00
using isnd.Attributes;
2021-09-05 15:44:47 +01:00
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);
}
}
}