This commit is contained in:
@@ -7,8 +7,15 @@ using Microsoft.Extensions.Logging;
|
||||
using AyaNova.Models;
|
||||
using AyaNova.Api.ControllerHelpers;
|
||||
using AyaNova.Biz;
|
||||
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using AyaNova.Util;
|
||||
using AyaNova.Api.ControllerHelpers;
|
||||
using AyaNova.Models;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace AyaNova.Api.Controllers
|
||||
{
|
||||
@@ -151,7 +158,19 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Status list
|
||||
/// </summary>
|
||||
/// <returns>List in alphabetical order of all work order status items</returns>
|
||||
[HttpGet("list")]
|
||||
public async Task<IActionResult> StatusList()
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
if (!Authorized.HasSelectRole(HttpContext.Items, AyaType.WorkOrderStatus))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
return Ok(ApiOkResponse.Response(await ct.WorkOrderStatus.AsNoTracking().OrderBy(z => z.Name).ToListAsync()));
|
||||
}
|
||||
|
||||
//------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user