29 lines
782 B
C#
29 lines
782 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using PlotLine.Services;
|
|
using PlotLine.ViewModels;
|
|
|
|
namespace PlotLine.Controllers;
|
|
|
|
[Authorize]
|
|
public sealed class ContinuityExplorerController(IStoryStateService storyState) : Controller
|
|
{
|
|
public async Task<IActionResult> Index([FromQuery] ContinuityFilter filter)
|
|
{
|
|
if (filter.ProjectID == 0)
|
|
{
|
|
return BadRequest("ProjectID is required.");
|
|
}
|
|
|
|
var model = await storyState.GetContinuityExplorerAsync(filter);
|
|
return model is null ? NotFound() : View(model);
|
|
}
|
|
|
|
[HttpPost]
|
|
[ValidateAntiForgeryToken]
|
|
public IActionResult ApplyFilters(ContinuityFilter filter)
|
|
{
|
|
return RedirectToAction(nameof(Index), filter);
|
|
}
|
|
}
|