Skip to content

Commit

Permalink
Fix validation message
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Aug 18, 2022
1 parent 53ac0bf commit 59ee303
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.2] - 2022-08-10

### Fixed

* **Setup**: Fixed validation message.

## [1.2.1] - 2022-08-10

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions backend/src/Notifo/Areas/Account/Pages/Profile.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Notifo.Areas.Account.Pages.Utils;
using Notifo.Identity;
using Notifo.Infrastructure.Tasks;
using NotifoValidationException = Notifo.Infrastructure.Validation.ValidationException;

#pragma warning disable MA0048 // File name must match type name

Expand Down Expand Up @@ -156,6 +157,10 @@ private async Task<IActionResult> MakeChangeAsync(Func<string, CancellationToken

return RedirectToPage(new { statusMessage });
}
catch (NotifoValidationException ex)
{
ErrorMessage = ex.Message;
}
catch (ValidationException ex)
{
ErrorMessage = ex.Message;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/Notifo/Areas/Account/Pages/Setup.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

@if (!string.IsNullOrWhiteSpace(Model!.ErrorMessage))
{
<div class="form-alert form-alert-error">
<div class="alert alert-danger">
@Model!.ErrorMessage
</div>
}
Expand Down
5 changes: 5 additions & 0 deletions backend/src/Notifo/Areas/Account/Pages/Setup.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Notifo.Identity;
using Notifo.Infrastructure.Reflection;
using Squidex.Assets;
using NotifoValidationException = Notifo.Infrastructure.Validation.ValidationException;

#pragma warning disable MA0048 // File name must match type name

Expand Down Expand Up @@ -88,6 +89,10 @@ public async Task<IActionResult> OnPost(CreateUserModel model)

return RedirectTo("~/");
}
catch (NotifoValidationException ex)
{
ErrorMessage = ex.Message;
}
catch (ValidationException ex)
{
ErrorMessage = ex.Message;
Expand Down

0 comments on commit 59ee303

Please sign in to comment.