This commit is contained in:
2018-09-04 22:24:55 +00:00
parent 81fcc16486
commit 56a68b40b4
2 changed files with 13 additions and 24 deletions

View File

@@ -120,8 +120,8 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
UserBiz biz = new UserBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
ApiPagedResponse<User> pr = await biz.GetManyAsync(Url, nameof(ListUsers), pagingOptions);
return Ok(new ApiOkWithPagingResponse<User>(pr));
ApiPagedResponse<System.Object> pr = await biz.GetManyAsync(Url, nameof(ListUsers), pagingOptions);
return Ok(new ApiOkWithPagingResponse<System.Object>(pr));
}
@@ -354,30 +354,12 @@ namespace AyaNova.Api.Controllers
//return success and link
//NOTE: this is a USER object so we don't want to return some key fields for security reasons
//So the easiest way to do that is to return an anonymous object created on the fly
// var returnObject = new
// {
// Id = o.Id,
// ConcurrencyToken = o.ConcurrencyToken,
// OwnerId = o.OwnerId,
// Active = o.Active,
// Name = o.Name,
// Roles = o.Roles,
// LocaleId = o.LocaleId,
// UserType = o.UserType,
// EmployeeNumber = o.EmployeeNumber,
// Notes = o.Notes,
// ClientId = o.ClientId,
// HeadOfficeId = o.HeadOfficeId,
// SubVendorId = o.SubVendorId
// };
//which is why the object is "cleaned" before return
return CreatedAtAction("GetUser", new { id = o.Id }, new ApiCreatedResponse(UserBiz.CleanUserForReturn(o)));
}
}
/// <summary>