1
0
mirror of https://github.com/bitwarden/server synced 2025-12-29 14:43:39 +00:00

filter status

This commit is contained in:
Kyle Spearrin
2017-03-25 21:53:32 -04:00
parent 1158e7051d
commit da29160218
5 changed files with 17 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ using Dapper;
using System.Linq;
using Bit.Core.Models.Data;
using System.Collections.Generic;
using Bit.Core.Enums;
namespace Bit.Core.Repositories.SqlServer
{
@@ -61,13 +62,14 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task<ICollection<OrganizationUserOrganizationDetails>> GetManyDetailsByUserAsync(Guid userId)
public async Task<ICollection<OrganizationUserOrganizationDetails>> GetManyDetailsByUserAsync(Guid userId,
OrganizationUserStatusType? status = null)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<OrganizationUserOrganizationDetails>(
"[dbo].[OrganizationUserOrganizationDetails_ReadByUserId]",
new { UserId = userId },
"[dbo].[OrganizationUserOrganizationDetails_ReadByUserIdStatus]",
new { UserId = userId, Status = status },
commandType: CommandType.StoredProcedure);
return results.ToList();