intake/web/item.go
Tim Van Baak af77322755 Add link to item page
This will be useful later for editing items
2025-01-27 20:28:46 -08:00

21 lines
414 B
Go

package web
import (
"net/http"
"github.com/Jaculabilis/intake/core"
"github.com/Jaculabilis/intake/web/html"
)
func (env *Env) getItem(writer http.ResponseWriter, req *http.Request) {
source := req.PathValue("source")
id := req.PathValue("id")
item, err := core.GetItem(env.db, source, id)
if err != nil {
writer.Write([]byte(err.Error()))
return
}
html.Item(writer, html.ItemData{Item: item})
}