Initial commit

This commit is contained in:
Popov_Grigorii
2026-07-15 17:17:03 +03:00
commit cc078a2c8d
94 changed files with 76773 additions and 0 deletions
@@ -0,0 +1,4 @@
@page
@model ListmonkIntegration.Pages.api.ListsModel
@{
}
@@ -0,0 +1,35 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc;
using ListmonkIntegration.Services;
namespace ListmonkIntegration.Pages.api
{
[IgnoreAntiforgeryToken]
public class ListsModel : PageModel
{
private readonly IListmonkService _listmonkService;
private readonly ILogger<ListsModel> _logger;
public ListsModel(IListmonkService listmonkService, ILogger<ListsModel> logger)
{
_listmonkService = listmonkService;
_logger = logger;
}
public async Task<IActionResult> OnGetAttributesAsync(int id)
{
try
{
_logger.LogInformation($"API: Getting attributes for list {id}");
var attributes = await _listmonkService.GetListAttributesAsync(id);
_logger.LogInformation($"API: Found {attributes.Count} attributes");
return new JsonResult(attributes);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error getting attributes");
return new JsonResult(new List<string>()) { StatusCode = 500 };
}
}
}
}