Get endpoint for LOK open hours
This commit is contained in:
21
api/Public/Endpoints/LokEndpoints.cs
Normal file
21
api/Public/Endpoints/LokEndpoints.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
public static class LokEndpoints
|
||||
{
|
||||
public static void MapLokEndpoints(WebApplication app)
|
||||
{
|
||||
app.MapGet("/lok/open-hours", async (LokService lokService) =>
|
||||
{
|
||||
var openHours = await lokService.GetOpenHoursAsync();
|
||||
|
||||
if (openHours is null)
|
||||
{
|
||||
return Results.NotFound(new
|
||||
{
|
||||
Message = "Open hours not found."
|
||||
});
|
||||
}
|
||||
|
||||
return Results.Ok(openHours);
|
||||
})
|
||||
.WithName("GetLokOpenHours");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user