From 6993db5923ab28f23b744268c65c919b6ff378c1 Mon Sep 17 00:00:00 2001 From: Masterjun Date: Wed, 6 Nov 2024 05:47:17 +0100 Subject: [PATCH] elaborate on poll option errors (#2030) --- TASVideos/Pages/Forum/Topics/AddEditPoll.cshtml.cs | 2 +- TASVideos/Pages/Forum/Topics/Create.cshtml.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TASVideos/Pages/Forum/Topics/AddEditPoll.cshtml.cs b/TASVideos/Pages/Forum/Topics/AddEditPoll.cshtml.cs index ec9b9ed39..e7272220e 100644 --- a/TASVideos/Pages/Forum/Topics/AddEditPoll.cshtml.cs +++ b/TASVideos/Pages/Forum/Topics/AddEditPoll.cshtml.cs @@ -62,7 +62,7 @@ public async Task OnPost() if (!Poll.OptionsAreValid) { - ModelState.AddModelError($"{nameof(Poll)}.{nameof(Poll.PollOptions)}", "Invalid poll options"); + ModelState.AddModelError($"{nameof(Poll)}.{nameof(Poll.PollOptions)}", "Enter at least 2 options. Each option must be a string with a maximum length of 250."); return Page(); } diff --git a/TASVideos/Pages/Forum/Topics/Create.cshtml.cs b/TASVideos/Pages/Forum/Topics/Create.cshtml.cs index 8201ca690..98f54dc66 100644 --- a/TASVideos/Pages/Forum/Topics/Create.cshtml.cs +++ b/TASVideos/Pages/Forum/Topics/Create.cshtml.cs @@ -89,7 +89,7 @@ public async Task OnPost() if (!Poll.OptionsAreValid) { - ModelState.AddModelError($"{nameof(Poll.PollOptions)}", "Invalid poll options"); + ModelState.AddModelError($"{nameof(Poll.PollOptions)}", "Enter at least 2 options. Each option must be a string with a maximum length of 250."); return Page(); } }