Having the clear locations endpoint only clear world locations, and adding endpoint to remove all items
This commit is contained in:
@@ -2,6 +2,7 @@ using GameAuthApi.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Threading.Tasks;
|
||||
using GameAuthApi.Models;
|
||||
|
||||
namespace GameAuthApi.Controllers;
|
||||
|
||||
@@ -23,5 +24,21 @@ public class AdminController : ControllerBase
|
||||
var status = await _adminService.GetStatusAsync();
|
||||
return Ok(status);
|
||||
}
|
||||
|
||||
[HttpPost("reset-locations")]
|
||||
[Authorize(Roles = "SUPER")]
|
||||
public async Task<IActionResult> ResetLocations()
|
||||
{
|
||||
var origin = await _adminService.ResetLocationsAsync();
|
||||
return Ok(origin);
|
||||
}
|
||||
|
||||
[HttpPost("clear-items")]
|
||||
[Authorize(Roles = "SUPER")]
|
||||
public async Task<IActionResult> ClearItems()
|
||||
{
|
||||
await _adminService.ClearItemsAsync();
|
||||
return Ok("All items cleared.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user