so mamy things...

This commit is contained in:
didier amyot committed 2015-07-05 17:17:01 -04:00
1 parent f7a8d416c1
commit 78d50d9a6d
24 files changed
+516 -173

No files matched your search

+21
View File
@@ -21,3 +21,24 @@ func GetDoorman(w http.ResponseWriter, r *http.Request) {
encoder.Encode(doorman)
}
}
func GetDoormanStatus(w http.ResponseWriter, r *http.Request) {
id := getDoormanIdFromRequest(w, r)
if id == "" {
Write404Error(w)
return
}
doorman, err := conn.GetDoorman(id)
if err != nil {
Write500Error(w, err)
} else if doorman == nil {
Write404Error(w)
}
if payload, err := doorman.AsDoormanUpdatePayload(); err != nil {
Write500Error(w, err)
} else {
w.Write(payload)
}
}