33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using Fitness_core_BE.DTOs.Rbac;
|
|
using Fitness_core_BE.Helpers;
|
|
using Fitness_core_BE.Interfaces.Services;
|
|
using Fitness_core_BE.Models.IOs;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using static Fitness_core_BE.Helpers.JwtMiddleware;
|
|
using static Fitness_core_BE.Helpers.ApiResponseHelper;
|
|
|
|
namespace Fitness_core_BE.Controllers
|
|
{
|
|
// Returns the permission-filtered sidebar nav for the current caller — the owner sees
|
|
// everything, staff see only what their assigned role permits.
|
|
[ApiController]
|
|
[Route("api/client")]
|
|
public class NavController : ControllerBase
|
|
{
|
|
private readonly INavigationService _navigationService;
|
|
|
|
public NavController(INavigationService navigationService)
|
|
{
|
|
_navigationService = navigationService;
|
|
}
|
|
|
|
[CustomMiddleware]
|
|
[TenantResolution]
|
|
[HttpGet("nav")]
|
|
public async Task<ActionResult<ApiResponse<NavResponseDto>>> GetNav()
|
|
{
|
|
return Response(await _navigationService.GetNavigationAsync(HttpContext));
|
|
}
|
|
}
|
|
}
|