mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-26 15:39:01 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user