1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-18 08:00:59 -05:00

cipher details with subvaults api

This commit is contained in:
Kyle Spearrin
2017-04-04 17:22:47 -04:00
parent 854c4f7871
commit 7d9a2cdd95
6 changed files with 71 additions and 3 deletions

View File

@ -8,5 +8,6 @@ namespace Bit.Core.Repositories
public interface ISubvaultCipherRepository
{
Task<ICollection<SubvaultCipher>> GetManyByUserIdAsync(Guid userId);
Task<ICollection<SubvaultCipher>> GetManyByUserIdCipherIdAsync(Guid userId, Guid cipherId);
}
}

View File

@ -31,5 +31,18 @@ namespace Bit.Core.Repositories.SqlServer
return results.ToList();
}
}
public async Task<ICollection<SubvaultCipher>> GetManyByUserIdCipherIdAsync(Guid userId, Guid cipherId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<SubvaultCipher>(
$"[dbo].[SubvaultCipher_ReadByUserIdCipherId]",
new { UserId = userId, CipherId = cipherId },
commandType: CommandType.StoredProcedure);
return results.ToList();
}
}
}
}