Implement Play Menu Tags management: add endpoints for retrieving and updating tags; enhance database schema and UI integration

This commit is contained in:
Alexa
2026-06-02 16:46:28 +03:00
parent a2feb780c2
commit 218d92f856
9 changed files with 335 additions and 41 deletions
@@ -1494,6 +1494,26 @@ public class AdminController(
return Ok(weekly);
}
[HttpGet("settings/play-menu-tags")]
public async Task<ActionResult> GetPlayMenuTags()
=> Ok(await serverSettings.GetPlayMenuTagsAsync());
public sealed record PlayMenuTagsRequest(
List<string>? PinnedTags,
List<string>? PopularTags);
[HttpPost("settings/play-menu-tags")]
public async Task<ActionResult> SetPlayMenuTags([FromBody] PlayMenuTagsRequest body)
{
var tags = await serverSettings.SetPlayMenuTagsAsync(
body.PinnedTags ?? [],
body.PopularTags ?? []);
await LogAsync("play_menu_tags_updated", "system", 0,
$"pinned={string.Join(",", tags.PinnedTags)} popular={string.Join(",", tags.PopularTags)}");
await db.SaveChangesAsync();
return Ok(tags);
}
// ── Signup codes ─────────────────────────────────────────────────────
/// <summary>GET <c>api/admin/v1/signup-codes</c> — every issued code