isn/src/isnd/Controllers/Packages/PackagesController.Delete.cs
2026-07-05 20:33:31 +01:00

25 lines
825 B
C#

using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using isnd.Helpers;
using isnd.Entities;
using System.ComponentModel.DataAnnotations;
using isnd.Attributes;
using System.Security.Claims;
using Isn.Abstract;
namespace isnd.Controllers
{
public partial class PackagesController
{
[HttpDelete("~/" + Constants.APIPrefix + ApiConfig.Delete + "/{id}/{lower?}/{type?}")]
public async Task<IActionResult> ApiDelete(
[FromRoute][SafeName][Required] string id,
[FromRoute][SafeName][Required] string lower,
[FromRoute] string type)
{
var uid = User.FindFirstValue(ClaimTypes.NameIdentifier);
var report = await packageManager.UserAskForPackageDeletionAsync(uid, id, lower, type);
return Ok(report);
}
}
}