cml04-falcon-system/handset/handlers/barcode.go

18 lines
454 B
Go
Raw Normal View History

2024-10-01 20:28:58 +02:00
package handlers
import (
"net/http"
"git.espin.casa/albert/cml04-falcon-system/handset/eventer"
"github.com/julienschmidt/httprouter"
)
func BarCodeHandler(eventer eventer.Eventer) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
barcode := ps.ByName("barcode")
if err := eventer.BarCode(r.Context(), barcode); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
}