Today menu api

This commit is contained in:
Elias Jansson
2025-06-25 09:19:16 +02:00
parent 7e5f71a61b
commit afeb459729

View File

@@ -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")]