Notes is optional when editing transaction
This commit is contained in:
@@ -84,6 +84,12 @@ namespace MoneyMap.Pages
|
|||||||
|
|
||||||
public async Task<IActionResult> OnPostAsync()
|
public async Task<IActionResult> OnPostAsync()
|
||||||
{
|
{
|
||||||
|
// Remove Notes from model state validation if it's empty
|
||||||
|
if (string.IsNullOrWhiteSpace(Transaction.Notes))
|
||||||
|
{
|
||||||
|
ModelState.Remove("Transaction.Notes");
|
||||||
|
}
|
||||||
|
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
{
|
{
|
||||||
await LoadDataAsync();
|
await LoadDataAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user