This commit is contained in:
@@ -271,7 +271,7 @@ namespace AyaNova.Api.Controllers
|
||||
/// </summary>
|
||||
/// <returns>Customer contact users</returns>
|
||||
[HttpGet("customer-contacts/{customerId}")]
|
||||
public async Task<IActionResult> GetClientContactList(long customerId)
|
||||
public async Task<IActionResult> GetCustomerContactList(long customerId)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
@@ -295,6 +295,36 @@ namespace AyaNova.Api.Controllers
|
||||
return Ok(ApiOkResponse.Response(ret));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list of HeadOffice Contact Users
|
||||
/// (Rights to HeadOffice object required)
|
||||
/// </summary>
|
||||
/// <returns>HeadOffice contact users</returns>
|
||||
[HttpGet("head-office-contacts/{headofficeId}")]
|
||||
public async Task<IActionResult> GetHeadOfficeContactList(long headofficeId)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.HeadOffice))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
var ret = await ct.User.Include(o => o.UserOptions).Where(z => z.UserType == UserType.HeadOffice && z.HeadOfficeId == headofficeId).Select(z => new
|
||||
{
|
||||
Id = z.Id,
|
||||
Active = z.Active,
|
||||
Name = z.Name,
|
||||
UserType = z.UserType,
|
||||
LastLogin = z.LastLogin,
|
||||
EmailAddress = z.UserOptions.EmailAddress,
|
||||
Phone1 = z.UserOptions.Phone1,
|
||||
Phone2 = z.UserOptions.Phone2,
|
||||
Phone3 = z.UserOptions.Phone3
|
||||
|
||||
}).ToListAsync();
|
||||
return Ok(ApiOkResponse.Response(ret));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user