WIP reg page

This commit is contained in:
Paul Schneider 2022-09-23 20:34:51 +01:00
commit fececb327e
36 changed files with 264 additions and 211 deletions

View file

@ -4,17 +4,20 @@ using isnd.Helpers;
using isnd.Entities;
using System.ComponentModel.DataAnnotations;
using isnd.Attributes;
using System.Security.Claims;
namespace isnd.Controllers
{
public partial class PackagesController
{
[HttpDelete(_pkgRootPrefix + ApiConfig.Delete + "/{id}/{*lower}")]
public async Task<IActionResult> Delete(
[HttpDelete(_pkgRootPrefix + ApiConfig.Delete + "/{id}/{lower?}/{type?}")]
public async Task<IActionResult> ApiDelete(
[FromRoute][SafeName][Required] string id,
[FromRoute][SafeName][Required] string lower)
[FromRoute][SafeName][Required] string lower,
[FromRoute] string type)
{
string pkgtype = ParamHelpers.Optional(ref lower);
var report = await packageManager.DeletePackageAsync(id, lower, pkgtype);
var uid = User.FindFirstValue(ClaimTypes.NameIdentifier);
var report = await packageManager.UserAskForPackageDeletionAsync(uid, id, lower, type);
return Ok(report);
}
}