This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
bactdb/api/observation_types.go
2014-11-03 16:12:50 -09:00

22 lines
370 B
Go

package api
import (
"net/http"
"strconv"
"github.com/gorilla/mux"
)
func serveObservationType(w http.ResponseWriter, r *http.Request) error {
id, err := strconv.ParseInt(mux.Vars(r)["Id"], 10, 0)
if err != nil {
return err
}
observation_type, err := store.ObservationTypes.Get(id)
if err != nil {
return err
}
return writeJSON(w, observation_type)
}