Webhook: Add missing model validation (#4636)

Fixes #4628.
This commit is contained in:
d11n 2023-02-14 14:37:35 +01:00 committed by GitHub
parent fea27b900c
commit 8e8ba3d052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,6 +118,8 @@ namespace BTCPayServer.Controllers
var webhook = await _Repo.GetWebhook(CurrentStore.Id, webhookId);
if (webhook is null)
return NotFound();
if (!ModelState.IsValid)
return View(nameof(ModifyWebhook), viewModel);
await _Repo.UpdateWebhook(CurrentStore.Id, webhookId, viewModel.CreateBlob());
TempData[WellKnownTempData.SuccessMessage] = "The webhook has been updated";