move config routes to new controller - fixes #20
This commit is contained in:
parent
fbbd5933ed
commit
61a4140b6e
|
@ -28,18 +28,5 @@ namespace AccessQueueService.Controllers
|
||||||
{
|
{
|
||||||
return await _accessService.RevokeAccess(id);
|
return await _accessService.RevokeAccess(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("configuration")]
|
|
||||||
public ActionResult<AccessQueueConfig> GetConfiguration()
|
|
||||||
{
|
|
||||||
return Ok(_accessService.GetConfiguration());
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost("configuration")]
|
|
||||||
public IActionResult UpdateConfiguration([FromBody] AccessQueueConfig config)
|
|
||||||
{
|
|
||||||
_accessService.PatchConfiguration(config);
|
|
||||||
return NoContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
using AccessQueueService.Models;
|
||||||
|
using AccessQueueService.Services;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace AccessQueueService.Controllers
|
||||||
|
{
|
||||||
|
[ApiController]
|
||||||
|
[Route("config")]
|
||||||
|
public class ConfigurationController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IAccessService _accessService;
|
||||||
|
|
||||||
|
public ConfigurationController(IAccessService accessService)
|
||||||
|
{
|
||||||
|
_accessService = accessService;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public ActionResult<AccessQueueConfig> GetConfiguration()
|
||||||
|
{
|
||||||
|
return Ok(_accessService.GetConfiguration());
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult UpdateConfiguration([FromBody] AccessQueueConfig config)
|
||||||
|
{
|
||||||
|
_accessService.PatchConfiguration(config);
|
||||||
|
return NoContent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue