-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from Geta/feature/edit-redirects
Add possibility to edit redirects
- Loading branch information
Showing
12 changed files
with
443 additions
and
230 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...otFoundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages/Components/Pager/Default.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...oundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages/Extensions/ModelStateExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.AspNetCore.Mvc.ModelBinding; | ||
|
||
namespace Geta.NotFoundHandler.Admin.Areas.GetaNotFoundHandlerAdmin.Pages.Extensions; | ||
|
||
public static class ModelStateExtensions | ||
{ | ||
public static ModelStateDictionary RemoveNestedKeys(this ModelStateDictionary source, string prefix) | ||
{ | ||
foreach (var key in source.Keys) | ||
{ | ||
if (key.StartsWith($"{prefix}.")) | ||
{ | ||
source.Remove(key); | ||
} | ||
} | ||
|
||
return source; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.