1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-17 23:50:58 -05:00

organization signup apis and data model changes

This commit is contained in:
Kyle Spearrin
2017-03-03 00:07:11 -05:00
parent b18b6a44ef
commit 29e3605576
20 changed files with 371 additions and 131 deletions

View File

@ -7,6 +7,6 @@ namespace Bit.Core.Repositories
{
public interface IOrganizationUserRepository : IRepository<OrganizationUser, Guid>
{
Task<OrganizationUser> GetByIdAsync(Guid id, Guid userId);
Task<OrganizationUser> GetByOrganizationAsync(Guid organizationId, Guid userId);
}
}

View File

@ -18,13 +18,13 @@ namespace Bit.Core.Repositories.SqlServer
: base(connectionString)
{ }
public async Task<OrganizationUser> GetByIdAsync(Guid id, Guid userId)
public async Task<OrganizationUser> GetByOrganizationAsync(Guid organizationId, Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<OrganizationUser>(
"[dbo].[OrganizationUser_ReadByIdUserId]",
new { Id = id, UserId = userId },
new { OrganizationId = organizationId, UserId = userId },
commandType: CommandType.StoredProcedure);
return results.SingleOrDefault();