🐛 Fix org publisher creation missing validation as well

This commit is contained in:
2025-08-19 21:34:27 +08:00
parent 2fdefae718
commit d555fcaf17

View File

@@ -329,6 +329,8 @@ public class PublisherController(
public async Task<ActionResult<Publisher>> CreatePublisherOrganization(string realmSlug,
[FromBody] PublisherRequest request)
{
if (string.IsNullOrEmpty(request.Name) || string.IsNullOrEmpty(request.Nick))
return BadRequest("Name and Nick are required.");
if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();
var realm = await db.Realms.FirstOrDefaultAsync(r => r.Slug == realmSlug);