From 7fdf8c0682369cb307a2a39e93ce4a7efe6e4c82 Mon Sep 17 00:00:00 2001 From: tleodev Date: Mon, 16 Jun 2025 12:33:11 +0200 Subject: [PATCH] Add GetAll Catalog --- src/CatalogService/Controllers/ExercicesController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/CatalogService/Controllers/ExercicesController.cs b/src/CatalogService/Controllers/ExercicesController.cs index 97989a8..5c88f39 100644 --- a/src/CatalogService/Controllers/ExercicesController.cs +++ b/src/CatalogService/Controllers/ExercicesController.cs @@ -75,4 +75,13 @@ public class ExercicesController : ControllerBase return _mapper.Map(exercice); } + + [HttpGet] + public async Task>> GetAll() + { + //if (User.Identity.Name != "admin") return Forbid(); + + var exercices = await _context.Exercices.ToListAsync(); + return Ok(_mapper.Map>(exercices)); + } } \ No newline at end of file