using BeReadyBackend.DTO.Users; using BeReadyBackend.Repositories; using BeReadyBackend.Services; using BeReadyBackend.Specifications.Users; using FastEndpoints; namespace BeReadyBackend.Endpoints.Users; public class GetAllUsersEndpoint(UsersRepository usersRepository, UserService userService) : EndpointWithoutRequest> { public override void Configure() { Get("/Users/"); } public override async Task HandleAsync(CancellationToken ct) { int userId = userService.GetUserIdFromToken(); await Send.OkAsync(await usersRepository.ProjectToListAsync(new GetUserNotMeSpec(userId), ct), ct); } }