| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 | using Microsoft.AspNetCore.Mvc;
using UnivateProperties_API.Repository.Properties;
namespace UnivateProperties_API.Controllers.Properties
{
    [Route("api/[controller]")]
    [ApiController]
    public class PropertyFieldsController : ControllerBase
    {
        private readonly IUserDefinedGroupRepository _Repo;
        public PropertyFieldsController(IUserDefinedGroupRepository repo)
        {
            _Repo = repo;
        }
        [HttpGet]
        public IActionResult Get()
        {
            return new OkObjectResult(_Repo.GetFieldList(""));
        }
        [HttpGet("{name}")]
        public IActionResult Get(string name)
        {
            return new OkObjectResult(_Repo.GetFieldList(name));
        }
        [HttpGet("{PropertyType}/{type}")]
        public IActionResult Get(string PropertyType, string type)
        {
            return new OkObjectResult(_Repo.GetFieldListByPropType(type));
        }
        [HttpGet("GetSavedValues/{propertyType}/{name}/{id}")]
        public IActionResult GetSavedValues(string propertyType, string name, int id)
        {
            return new OkObjectResult(_Repo.GetFieldList(propertyType, name, id));
        }
    }
}
 |