1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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.Providers.Interfaces;
using Bit.Core.AdminConsole.Repositories; using Bit.Core.AdminConsole.Repositories;
using Bit.Core.Billing.Commands; using Bit.Core.Billing.Commands;
using Bit.Core.Exceptions;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
@ -55,10 +56,18 @@ public class ProviderOrganizationsController : Controller
return RedirectToAction("View", "Providers", new { id = providerId }); return RedirectToAction("View", "Providers", new { id = providerId });
} }
await _removeOrganizationFromProviderCommand.RemoveOrganizationFromProvider( try
provider, {
providerOrganization, await _removeOrganizationFromProviderCommand.RemoveOrganizationFromProvider(
organization); provider,
providerOrganization,
organization);
}
catch (BadRequestException ex)
{
return BadRequest(ex.Message);
}
await _removePaymentMethodCommand.RemovePaymentMethod(organization); await _removePaymentMethodCommand.RemovePaymentMethod(organization);

View File

@ -12,7 +12,7 @@
window.location.href = `@Url.Action("Edit", "Providers")?id=${providerId}`; window.location.href = `@Url.Action("Edit", "Providers")?id=${providerId}`;
}, },
error: function (response) { error: function (response) {
alert("Error!"); alert("Error!: " + response.responseText);
} }
}); });
} }