Notes is optional when editing transaction
This commit is contained in:
@@ -84,6 +84,12 @@ namespace MoneyMap.Pages
|
||||
|
||||
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)
|
||||
{
|
||||
await LoadDataAsync();
|
||||
|
||||
Reference in New Issue
Block a user