mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
exclude domains from sync option
This commit is contained in:
parent
3bf468c545
commit
826b4a430f
@ -46,7 +46,7 @@ namespace Bit.Api.Controllers
|
||||
}
|
||||
|
||||
[HttpGet("")]
|
||||
public async Task<SyncResponseModel> Get()
|
||||
public async Task<SyncResponseModel> Get([FromQuery]bool excludeDomains = false)
|
||||
{
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
if(user == null)
|
||||
@ -70,7 +70,7 @@ namespace Bit.Api.Controllers
|
||||
}
|
||||
|
||||
var response = new SyncResponseModel(_globalSettings, user, organizationUserDetails, folders,
|
||||
collections, ciphers, collectionCiphersGroupDict);
|
||||
collections, ciphers, collectionCiphersGroupDict, excludeDomains);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,8 @@ namespace Bit.Core.Models.Api
|
||||
IEnumerable<Folder> folders,
|
||||
IEnumerable<CollectionDetails> collections,
|
||||
IEnumerable<CipherDetails> ciphers,
|
||||
IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersDict)
|
||||
IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersDict,
|
||||
bool excludeDomains)
|
||||
: base("sync")
|
||||
{
|
||||
Profile = new ProfileResponseModel(user, organizationUserDetails);
|
||||
@ -24,7 +25,7 @@ namespace Bit.Core.Models.Api
|
||||
Ciphers = ciphers.Select(c => new CipherDetailsResponseModel(c, globalSettings, collectionCiphersDict));
|
||||
Collections = collections?.Select(
|
||||
c => new CollectionDetailsResponseModel(c)) ?? new List<CollectionDetailsResponseModel>();
|
||||
Domains = new DomainsResponseModel(user, false);
|
||||
Domains = excludeDomains ? null : new DomainsResponseModel(user, false);
|
||||
}
|
||||
|
||||
public ProfileResponseModel Profile { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user