Improve error message if you can't create an invoice in the UI

This commit is contained in:
nicolas.dorier 2018-04-05 15:44:27 +09:00
parent 6270a626fb
commit 1cc5427cbb

View file

@ -443,11 +443,14 @@ namespace BTCPayServer.Controllers
StatusMessage = null; StatusMessage = null;
if (store.Role != StoreRoles.Owner) if (store.Role != StoreRoles.Owner)
{ {
StatusMessage = "Error: You need to be owner of this store to create an invoice"; ModelState.AddModelError(nameof(model.StoreId), "You need to be owner of this store to create an invoice");
return View(model);
} }
if (store.GetSupportedPaymentMethods(_NetworkProvider).Count() == 0) if (store.GetSupportedPaymentMethods(_NetworkProvider).Count() == 0)
{ {
StatusMessage = "Error: You need to configure the derivation scheme in order to create an invoice"; ModelState.AddModelError(nameof(model.StoreId), "You need to configure the derivation scheme in order to create an invoice");
return View(model);
} }
if(StatusMessage != null) if(StatusMessage != null)