Get layer by number
This commit is contained in:
@@ -78,8 +78,7 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
[Route("{id}")]
|
||||
public IActionResult Get(Guid id)
|
||||
[Route("{id}")] public IActionResult Get(Guid id)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -94,6 +93,26 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
}
|
||||
[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}")]
|
||||
public IActionResult ExportToGoogleSheet(Guid id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user