mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-26 07:29:00 -07:00
23 lines
650 B
C#
23 lines
650 B
C#
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<IActionResult> 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));
|
|
}
|
|
}
|
|
} |