mirror of
https://github.com/bitwarden/server
synced 2025-12-20 02:03:46 +00:00
* resolves issue #4043 default values for itemsPerPage and startIndex * UsersController#Get now uses a queryParamModel Co-authored-by: Ahmad Mustafa Jebran <jebran.mustafa@gmail.com> Co-authored-by: Luris Solis <solisluris@gmail.com> * Test now passes, default 50 is represented --------- Co-authored-by: Jared McCannon <jmccannon@bitwarden.com>
This commit is contained in:
@@ -57,17 +57,15 @@ public class UsersController : Controller
|
||||
[HttpGet("")]
|
||||
public async Task<IActionResult> Get(
|
||||
Guid organizationId,
|
||||
[FromQuery] string filter,
|
||||
[FromQuery] int? count,
|
||||
[FromQuery] int? startIndex)
|
||||
[FromQuery] GetUsersQueryParamModel model)
|
||||
{
|
||||
var usersListQueryResult = await _getUsersListQuery.GetUsersListAsync(organizationId, filter, count, startIndex);
|
||||
var usersListQueryResult = await _getUsersListQuery.GetUsersListAsync(organizationId, model);
|
||||
var scimListResponseModel = new ScimListResponseModel<ScimUserResponseModel>
|
||||
{
|
||||
Resources = usersListQueryResult.userList.Select(u => new ScimUserResponseModel(u)).ToList(),
|
||||
ItemsPerPage = count.GetValueOrDefault(usersListQueryResult.userList.Count()),
|
||||
ItemsPerPage = model.Count,
|
||||
TotalResults = usersListQueryResult.totalResults,
|
||||
StartIndex = startIndex.GetValueOrDefault(1),
|
||||
StartIndex = model.StartIndex,
|
||||
};
|
||||
return Ok(scimListResponseModel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user