diff --git a/Aberwyn/Controllers/MealMenuApiController.cs b/Aberwyn/Controllers/MealMenuApiController.cs index ceb16ed..b62d317 100644 --- a/Aberwyn/Controllers/MealMenuApiController.cs +++ b/Aberwyn/Controllers/MealMenuApiController.cs @@ -62,6 +62,23 @@ namespace Aberwyn.Controllers } + [HttpGet("today")] + public IActionResult GetTodayMenu() + { + var today = DateTime.Today; + var menu = _menuService.GetMenuForDate(today); + + if (menu == null) + return NotFound(new { message = "Ingen meny hittades för idag." }); + + return Ok(new + { + date = today.ToString("yyyy-MM-dd"), + lunch = menu.LunchMealName ?? "", + dinner = menu.DinnerMealName ?? "", + breakfast = menu.BreakfastMealName ?? "" + }); + } [HttpPut("menu")]