1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-29 23:01:46 +01:00

update app cache when editing orgs from admin

This commit is contained in:
Kyle Spearrin 2019-06-13 00:31:50 -04:00
parent 6f0d64119a
commit 7b27443e5f

View File

@ -18,17 +18,20 @@ namespace Bit.Admin.Controllers
private readonly IOrganizationRepository _organizationRepository;
private readonly IOrganizationUserRepository _organizationUserRepository;
private readonly IPaymentService _paymentService;
private readonly IApplicationCacheService _applicationCacheService;
private readonly GlobalSettings _globalSettings;
public OrganizationsController(
IOrganizationRepository organizationRepository,
IOrganizationUserRepository organizationUserRepository,
IPaymentService paymentService,
IApplicationCacheService applicationCacheService,
GlobalSettings globalSettings)
{
_organizationRepository = organizationRepository;
_organizationUserRepository = organizationUserRepository;
_paymentService = paymentService;
_applicationCacheService = applicationCacheService;
_globalSettings = globalSettings;
}
@ -99,6 +102,7 @@ namespace Bit.Admin.Controllers
model.ToOrganization(organization);
await _organizationRepository.ReplaceAsync(organization);
await _applicationCacheService.UpsertOrganizationAbilityAsync(organization);
return RedirectToAction("Edit", new { id });
}
@ -110,6 +114,7 @@ namespace Bit.Admin.Controllers
if(organization != null)
{
await _organizationRepository.DeleteAsync(organization);
await _applicationCacheService.DeleteOrganizationAbilityAsync(organization.Id);
}
return RedirectToAction("Index");