You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
PortfolioLink/backend/Controllers/TemplateConfigController.cs

34 lines
884 B

using Microsoft.AspNetCore.Mvc;
using backend.Models;
using Newtonsoft.Json;
using Microsoft.AspNetCore.Cors;
namespace backend.Controllers
{
[Route("api/template")]
[ApiController]
public class TemplateConfigController : ControllerBase
{
private readonly IConfiguration _config;
public TemplateConfigController(IConfiguration configuration)
{
_config = configuration;
}
[HttpGet]
public ActionResult<string> Get()
{
Console.WriteLine("template get triggered");
List<ColumnStandard>? dataStandard = _config.GetSection("DataStandard").Get<List<ColumnStandard>>();
if (dataStandard == null)
{
return "Failed to retreieve data standard!";
}
return JsonConvert.SerializeObject(dataStandard);
}
}
}