using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using WorkFlowCheck.Web.Services.Interfaces;

namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
{
    public class CheckListHeaderPageModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;
        private readonly ICheckListService _checkListService;
        public CheckListHeaderPageModel(ILogger<IndexModel> logger, ICheckListService checkListService)
        {
            _logger = logger;
            _checkListService = checkListService;
        }
        public async Task OnGet()
        {
        }
        public async Task<JsonResult> OnGetLoadCheckListHeaders()
        {
            var results = await _checkListService.GetAllCheckListHeaderAsync();
            return new JsonResult(new { data = results });
        }
    }
}
