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

namespace WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateHeader
{
    public class CheckListTemplateHeaderPageModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;
        private readonly ICheckListService _checkListService;
        public CheckListTemplateHeaderPageModel(ILogger<IndexModel> logger, ICheckListService checkListService)
        {
            _logger = logger;
            _checkListService = checkListService;
        }
        public async Task OnGet()
        {
        }
        public async Task<JsonResult> OnGetLoadCheckListTemplateHeaders()
        {
            var results = await _checkListService.GetAllCheckListTemplateHeaderAsync();
            return new JsonResult(new { data = results });
        }
    }
}
