1
0
mirror of https://github.com/bitwarden/server synced 2025-12-16 00:03:54 +00:00

Fix the issue of returning on Error! without descriptive message (#4056)

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
cyprain-okeke
2024-05-07 17:45:01 +01:00
committed by GitHub
parent ea49ff7dcb
commit 6bdee5dd34
2 changed files with 14 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ using Bit.Admin.Utilities;
using Bit.Core.AdminConsole.Providers.Interfaces;
using Bit.Core.AdminConsole.Repositories;
using Bit.Core.Billing.Commands;
using Bit.Core.Exceptions;
using Bit.Core.Repositories;
using Bit.Core.Utilities;
using Microsoft.AspNetCore.Authorization;
@@ -55,10 +56,18 @@ public class ProviderOrganizationsController : Controller
return RedirectToAction("View", "Providers", new { id = providerId });
}
await _removeOrganizationFromProviderCommand.RemoveOrganizationFromProvider(
provider,
providerOrganization,
organization);
try
{
await _removeOrganizationFromProviderCommand.RemoveOrganizationFromProvider(
provider,
providerOrganization,
organization);
}
catch (BadRequestException ex)
{
return BadRequest(ex.Message);
}
await _removePaymentMethodCommand.RemovePaymentMethod(organization);