using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using TaxBaik.Application.Services;
using TaxBaik.Domain.Entities;
using TaxBaik.Web.Services;

namespace TaxBaik.Web.Pages.Admin.Faqs;

[Authorize(AuthenticationSchemes = AdminAuthDefaults.Scheme)]
public class DetailModel(FaqService faqService) : PageModel
{
    public Faq? Item { get; private set; }

    public async Task<IActionResult> OnGetAsync(int id, CancellationToken ct)
    {
        Item = await faqService.GetByIdAsync(id, ct);
        return Page();
    }
}
