Add a resource for getting service requests

This commit is contained in:
Eli Ribble 2026-04-14 19:59:32 +00:00
parent 28ec1c3d67
commit 4a440e3022
No known key found for this signature in database
18 changed files with 387 additions and 51 deletions

View file

@ -47,11 +47,14 @@ func AddRoutes(r *mux.Router) {
r.HandleFunc("/rmo/nuisance", handlerFormPost(nuisance.Create)).Methods("POST")
water := resource.Water(router)
r.HandleFunc("/rmo/water", handlerFormPost(water.Create)).Methods("POST")
r.Handle("/service-request", auth.NewEnsureAuth(apiServiceRequest)).Methods("GET")
service_request := resource.ServiceRequest(router)
r.Handle("/service-request", authenticatedHandlerJSONSlice(service_request.List)).Methods("GET")
session := resource.Session(router)
r.Handle("/session", authenticatedHandlerJSON(session.Get)).Methods("GET").Name("session.get")
signal := resource.Signal(r)
r.Handle("/signal", authenticatedHandlerJSON(signal.List)).Methods("GET")
sync := resource.Sync(r)
r.Handle("/sync", authenticatedHandlerJSONSlice(sync.List)).Methods("GET")
r.Handle("/sudo/email", authenticatedHandlerJSONPost(postSudoEmail)).Methods("POST")
r.Handle("/sudo/sms", authenticatedHandlerJSONPost(postSudoSMS)).Methods("POST")
r.Handle("/sudo/sse", authenticatedHandlerJSONPost(postSudoSSE)).Methods("POST")