so mamy things...
This commit is contained in:
1 parent
f7a8d416c1
commit
78d50d9a6d
24 files changed
+516
-173
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user