using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using RadicadeServer.DB; using RadicadeServer.Extensions; using RadicadeServer.Utils; namespace RadicadeServer.API.Config { [Route("api/voicechat")] public class VoiceChatRestrictionAPI(RecDBContext db) : Controller { [HttpGet("restriction"), Authorize] public async Task GetRestriction() { var userId = User.GetUserId(); if (userId == null) return Unauthorized(new { restricted = false }); var restriction = await VoiceChatRestrictions.ActiveAsync(db, userId.Value); return Ok(VoiceChatRestrictions.Payload(restriction)); } } }