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:
parent
ea49ff7dcb
commit
6bdee5dd34
@ -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);
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user