This commit is contained in:
@@ -150,7 +150,24 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get prior rate Units entered
|
||||
/// </summary>
|
||||
/// <returns>list of Units</returns>
|
||||
[HttpGet("prior-unit-list")]
|
||||
public async Task<IActionResult> GetPriorUnits()
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
TravelRateBiz biz = TravelRateBiz.GetBiz(ct, HttpContext);
|
||||
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
var o = await biz.GetPriorUnitsAsync();
|
||||
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
return Ok(ApiOkResponse.Response(o));
|
||||
}
|
||||
|
||||
|
||||
//------------
|
||||
|
||||
@@ -190,8 +190,7 @@ namespace AyaNova.Biz
|
||||
//
|
||||
internal async Task<List<string>> GetPriorUnitsAsync()
|
||||
{
|
||||
var ret = await ct.ServiceRate.AsNoTracking().Select(x => x.Unit).Distinct().OrderBy(x => x).ToListAsync();
|
||||
return ret;
|
||||
return await ct.ServiceRate.AsNoTracking().Select(x => x.Unit).Distinct().OrderBy(x => x).ToListAsync();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -185,7 +185,13 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//GET PRIOR UNITS LIST
|
||||
//
|
||||
internal async Task<List<string>> GetPriorUnitsAsync()
|
||||
{
|
||||
return await ct.TravelRate.AsNoTracking().Select(x => x.Unit).Distinct().OrderBy(x => x).ToListAsync();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//SEARCH
|
||||
|
||||
Reference in New Issue
Block a user