using DrinkRateAPI.ApiModels.UserProfile; using DrinkRateAPI.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace DrinkRateAPI.Controllers; [ApiController] [Route("admin")] [Authorize(Policy = "AdminOnly")] public class AdminController : ControllerBase { private readonly ILogger _logger; private readonly UserProfileService _userProfileService; public AdminController(ILogger logger, UserProfileService userProfileService) { _logger = logger; _userProfileService = userProfileService; } [HttpPut("users/{userId}/adminStatus")] [Produces("application/json")] public async Task PutUserAdminStatus(string userId, [FromBody] ChangeAdminStatusBody body) { var changedProfile = await _userProfileService.ChangeUserAdminStatusAsync(userId, body.ChangeStatusTo); return Ok(changedProfile); } }