Compare commits
	
		
			2 Commits
		
	
	
		
			e78858b7b4
			...
			d555fcaf17
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d555fcaf17 | |||
| 2fdefae718 | 
| @@ -240,7 +240,14 @@ public class PublisherController( | ||||
|  | ||||
|     public class PublisherRequest | ||||
|     { | ||||
|         [MaxLength(256)] public string? Name { get; set; } | ||||
|         [RegularExpression( | ||||
|             @"^[a-zA-Z0-9](?:[a-zA-Z0-9\-_\.]*[a-zA-Z0-9])?$", | ||||
|             ErrorMessage = | ||||
|                 "Name must be URL-safe (alphanumeric, hyphens, underscores, or periods) and cannot start/end with special characters." | ||||
|         )] | ||||
|         [MaxLength(256)] | ||||
|         public string? Name { get; set; } | ||||
|  | ||||
|         [MaxLength(256)] public string? Nick { get; set; } | ||||
|         [MaxLength(4096)] public string? Bio { get; set; } | ||||
|  | ||||
| @@ -253,6 +260,8 @@ public class PublisherController( | ||||
|     [RequiredPermission("global", "publishers.create")] | ||||
|     public async Task<ActionResult<Publisher>> CreatePublisherIndividual([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 takenName = request.Name ?? currentUser.Name; | ||||
| @@ -320,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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user