Get layer by number
This commit is contained in:
@@ -78,8 +78,7 @@ namespace WebAPI.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{id}")]
|
[Route("{id}")] public IActionResult Get(Guid id)
|
||||||
public IActionResult Get(Guid id)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -94,6 +93,26 @@ namespace WebAPI.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[Route("getByNumber/{apiKey}/{number}")]
|
||||||
|
public IActionResult GetByNumber(string apiKey, int number)
|
||||||
|
{
|
||||||
|
if (apiKey != configuration["apiKey"])
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Ok(db.Layers
|
||||||
|
.Include(x => x.CreatedBy)
|
||||||
|
.Include(x => x.Records)
|
||||||
|
.Where(x => x.Number == number && !x.IsDeleted).First());
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return BadRequest(e.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[HttpGet]
|
||||||
[Route("exportToGoogleSheet/{id}")]
|
[Route("exportToGoogleSheet/{id}")]
|
||||||
public IActionResult ExportToGoogleSheet(Guid id)
|
public IActionResult ExportToGoogleSheet(Guid id)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user