mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-13 16:51:27 +00:00
Improve input validation for story level moderation
This commit is contained in:
parent
f965be88b7
commit
5c66b0f713
2 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ public class ModerationPageController : ControllerBase
|
|||
}
|
||||
|
||||
[HttpPost("findStoryLevel")]
|
||||
public async Task<IActionResult> FindStorySlot([FromForm] int placeholderSlotId)
|
||||
public async Task<IActionResult> FindStorySlot([FromForm] int? placeholderSlotId)
|
||||
{
|
||||
UserEntity? user = this.database.UserFromWebRequest(this.Request);
|
||||
if (user == null) return this.Redirect("~/login");
|
||||
|
@ -30,6 +30,6 @@ public class ModerationPageController : ControllerBase
|
|||
.Select(s => s.SlotId)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
return this.Redirect(slotId == 0 ? "~/" : $"~/slot/{slotId}");
|
||||
return this.Redirect(slotId == 0 ? "~/moderation" : $"~/slot/{slotId}");
|
||||
}
|
||||
}
|
|
@ -59,6 +59,6 @@ else
|
|||
<button type="submit" class="ui blue button">
|
||||
<span>Find Story Level</span>
|
||||
</button>
|
||||
<input type="text" name="placeholderSlotId" placeholder="Level ID">
|
||||
<input type="text" name="placeholderSlotId" placeholder="Level ID" minlength="1" pattern="^\d*$" required>
|
||||
</div>
|
||||
</form>
|
Loading…
Add table
Add a link
Reference in a new issue