From 826b4a430f5297e038a7eb23ff4678ab51fec6f3 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 25 Jun 2018 21:29:04 -0400 Subject: [PATCH] exclude domains from sync option --- src/Api/Controllers/SyncController.cs | 4 ++-- src/Core/Models/Api/Response/SyncResponseModel.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Api/Controllers/SyncController.cs b/src/Api/Controllers/SyncController.cs index 6153cae09..7f3ce3c04 100644 --- a/src/Api/Controllers/SyncController.cs +++ b/src/Api/Controllers/SyncController.cs @@ -46,7 +46,7 @@ namespace Bit.Api.Controllers } [HttpGet("")] - public async Task Get() + public async Task 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; } } diff --git a/src/Core/Models/Api/Response/SyncResponseModel.cs b/src/Core/Models/Api/Response/SyncResponseModel.cs index 6bd3103ed..38e80caf5 100644 --- a/src/Core/Models/Api/Response/SyncResponseModel.cs +++ b/src/Core/Models/Api/Response/SyncResponseModel.cs @@ -16,7 +16,8 @@ namespace Bit.Core.Models.Api IEnumerable folders, IEnumerable collections, IEnumerable ciphers, - IDictionary> collectionCiphersDict) + IDictionary> 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(); - Domains = new DomainsResponseModel(user, false); + Domains = excludeDomains ? null : new DomainsResponseModel(user, false); } public ProfileResponseModel Profile { get; set; }