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

collection groups management

This commit is contained in:
Kyle Spearrin
2017-05-11 12:22:14 -04:00
parent 2b8db4d1ed
commit d7f9977382
9 changed files with 38 additions and 27 deletions

View File

@ -8,6 +8,7 @@ using Bit.Core.Models.Api;
using Bit.Core.Exceptions;
using Bit.Core.Services;
using Bit.Core;
using Bit.Core.Models.Data;
namespace Bit.Api.Controllers
{
@ -91,7 +92,7 @@ namespace Bit.Api.Controllers
}
var collection = model.ToCollection(orgIdGuid);
await _collectionService.SaveAsync(collection, model.GroupIds?.Select(g => new Guid(g)));
await _collectionService.SaveAsync(collection, model.Groups?.Select(g => g.ToSelectionReadOnly()));
return new CollectionResponseModel(collection);
}
@ -105,7 +106,8 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
await _collectionService.SaveAsync(model.ToCollection(collection), model.GroupIds?.Select(g => new Guid(g)));
await _collectionService.SaveAsync(model.ToCollection(collection),
model.Groups?.Select(g => g.ToSelectionReadOnly()));
return new CollectionResponseModel(collection);
}