1
0
mirror of https://github.com/bitwarden/server synced 2026-01-07 19:13:50 +00:00

updated format of import data

This commit is contained in:
Kyle Spearrin
2017-05-15 14:41:20 -04:00
parent befca0561b
commit 670b548b22
9 changed files with 156 additions and 95 deletions

View File

@@ -16,5 +16,6 @@ namespace Bit.Core.Repositories
Task CreateAsync(Group obj, IEnumerable<SelectionReadOnly> collections);
Task ReplaceAsync(Group obj, IEnumerable<SelectionReadOnly> collections);
Task DeleteUserAsync(Guid groupId, Guid organizationUserId);
Task UpdateUsersAsync(Guid groupId, IEnumerable<Guid> organizationUserIds);
}
}

View File

@@ -130,6 +130,17 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task UpdateUsersAsync(Guid groupId, IEnumerable<Guid> organizationUserIds)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.ExecuteAsync(
"[dbo].[GroupUser_UpdateUsers]",
new { GroupId = groupId, OrganizationUserIds = organizationUserIds.ToGuidIdArrayTVP() },
commandType: CommandType.StoredProcedure);
}
}
public class GroupWithCollections : Group
{
public DataTable Collections { get; set; }