🐛 Fix pub name

This commit is contained in:
2025-08-05 17:49:52 +08:00
parent f5c8b75122
commit ce6f9a174f
2 changed files with 3 additions and 4 deletions

View File

@@ -107,7 +107,7 @@ public class PollController(AppDatabase db, PollService polls, PublisherService
[HttpPost]
[Authorize]
public async Task<ActionResult<Poll>> CreatePoll([FromBody] PollRequest request, [FromQuery] string pubName)
public async Task<ActionResult<Poll>> CreatePoll([FromBody] PollRequest request, [FromQuery(Name = "pub")] string pubName)
{
if (request.Questions is null) return BadRequest("Questions are required.");
if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();