diff options
| author | ivar <i@oiee.no> | 2023-11-11 22:09:47 +0100 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2023-11-11 22:09:47 +0100 |
| commit | 97e93e4669958ff7ac18886e0394cd63260d3c70 (patch) | |
| tree | a444b1ed9fd1d00411b2417d54f750b50bdc2167 /code/api/src/Models/Misc/KnownProblemModel.cs | |
| parent | 0fa8060856fde1ac887d1fefe3940ac494d236cb (diff) | |
| download | greatoffice-97e93e4669958ff7ac18886e0394cd63260d3c70.tar.xz greatoffice-97e93e4669958ff7ac18886e0394cd63260d3c70.zip | |
Fix usings
Diffstat (limited to 'code/api/src/Models/Misc/KnownProblemModel.cs')
| -rw-r--r-- | code/api/src/Models/Misc/KnownProblemModel.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/code/api/src/Models/Misc/KnownProblemModel.cs b/code/api/src/Models/Misc/KnownProblemModel.cs index 9acc85c..5a9927f 100644 --- a/code/api/src/Models/Misc/KnownProblemModel.cs +++ b/code/api/src/Models/Misc/KnownProblemModel.cs @@ -1,8 +1,9 @@ -namespace IOL.GreatOffice.Api.Data.Models; +namespace IOL.GreatOffice.Api.Models.Models; public class KnownProblemModel { - public KnownProblemModel(string title = default, string subtitle = default, Dictionary<string, string[]> errors = default) { + public KnownProblemModel(string title = default, string subtitle = default, Dictionary<string, string[]> errors = default) + { Title = title; Subtitle = subtitle; Errors = errors ?? new(); @@ -13,12 +14,16 @@ public class KnownProblemModel public Dictionary<string, string[]> Errors { get; set; } public string TraceId { get; set; } - public void AddError(string field, string errorText) { - if (!Errors.ContainsKey(field)) { - Errors.Add(field, new[] {errorText}); - } else { + public void AddError(string field, string errorText) + { + if (!Errors.ContainsKey(field)) + { + Errors.Add(field, [errorText]); + } + else + { var currentErrors = Errors[field]; - var newErrors = currentErrors.Concat(new[] {errorText}); + var newErrors = currentErrors.Concat(new[] { errorText }); Errors.Remove(field); Errors.Add(field, newErrors.ToArray()); } |
