using System.ComponentModel.DataAnnotations; using API.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Services; namespace API.Controllers; [ApiController] public class TacticController(ITacticService service) : ControllerBase { [HttpPut("/tactic/{tacticId:int}/name")] [Authorize] public async Task UpdateName( int tacticId, [Range(1, 50)] [Name] string name) { var userId = this.CurrentUserId(); if (!await service.HasAnyRights(userId, tacticId)) { return Forbid(); } return await service.UpdateName(tacticId, name) ? Ok() : NotFound(); } // [Authorize] // public async Task SetTacticStepContent(int tacticId, int stepId) // { // // } }