From 0eb3ffcdbe14ba84cac40dbb25a5613859f80370 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 10 Aug 2025 13:24:31 +0800 Subject: [PATCH] :boom: Sticker pack API follow other api publisher passing way --- DysonNetwork.Sphere/Sticker/StickerController.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/DysonNetwork.Sphere/Sticker/StickerController.cs b/DysonNetwork.Sphere/Sticker/StickerController.cs index 40e77f5..83f236c 100644 --- a/DysonNetwork.Sphere/Sticker/StickerController.cs +++ b/DysonNetwork.Sphere/Sticker/StickerController.cs @@ -99,7 +99,10 @@ public class StickerController(AppDatabase db, StickerService st, FileService.Fi [HttpPost] [RequiredPermission("global", "stickers.packs.create")] - public async Task> CreateStickerPack([FromBody] StickerPackRequest request) + public async Task> CreateStickerPack( + [FromBody] StickerPackRequest request, + [FromQuery(Name = "pub")] string publisherName + ) { if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized(); @@ -108,10 +111,6 @@ public class StickerController(AppDatabase db, StickerService st, FileService.Fi if (string.IsNullOrEmpty(request.Prefix)) return BadRequest("Prefix is required"); - var publisherName = Request.Headers["X-Pub"].ToString(); - if (string.IsNullOrEmpty(publisherName)) - return BadRequest("Publisher name is required in X-Pub header"); - var accountId = Guid.Parse(currentUser.Id); var publisher = await db.Publishers.FirstOrDefaultAsync(p => p.Name == publisherName && p.AccountId == accountId); @@ -398,4 +397,4 @@ public class StickerController(AppDatabase db, StickerService st, FileService.Fi return NoContent(); } -} \ No newline at end of file +}