mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 00:55:32 +00:00
20 lines
413 B
Go
20 lines
413 B
Go
package controllers
|
|
|
|
import (
|
|
"github.com/Theodor-Springmann-Stiftung/kgpz_web/xmlmodels"
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func GetPlace(kgpz *xmlmodels.Library) fiber.Handler {
|
|
return func(c *fiber.Ctx) error {
|
|
placeID := c.Params("place")
|
|
place := kgpz.Places.Item(placeID)
|
|
|
|
if place == nil {
|
|
return c.SendStatus(fiber.StatusNotFound)
|
|
}
|
|
|
|
return c.Render("/ort/", fiber.Map{"place": place})
|
|
}
|
|
}
|