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

namespace WorkFlowCheck.Web.Pages.UserAndRole
{
    public class UserRolePageModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;
        private readonly IUserService _userService;
        public UserRolePageModel(ILogger<IndexModel> logger, IUserService userService)
        {
            _logger = logger;
            _userService = userService;
        }
        public void OnGet()
        {
        }
        public async Task<JsonResult> OnGetLoadUserRoles()
        {
            var results = await _userService.GetAllUserRoles();
            return new JsonResult(new { data = results });
        }
    }
}
