get approvals endpoint
parent
f7532b50a2
commit
b43bc13828
|
@ -4,13 +4,11 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/rusenask/keel/types"
|
||||
)
|
||||
|
||||
func (s *TriggerServer) approvalsHandler(resp http.ResponseWriter, req *http.Request) {
|
||||
// unknown lists all
|
||||
approvals, err := s.approvalsManager.List(types.ProviderTypeUnknown)
|
||||
approvals, err := s.approvalsManager.List()
|
||||
if err != nil {
|
||||
fmt.Fprintf(resp, "%s", err)
|
||||
resp.WriteHeader(http.StatusInternalServerError)
|
||||
|
|
|
@ -79,6 +79,10 @@ func (s *TriggerServer) registerRoutes(mux *mux.Router) {
|
|||
mux.HandleFunc("/healthz", s.healthHandler).Methods("GET", "OPTIONS")
|
||||
// version handler
|
||||
mux.HandleFunc("/version", s.versionHandler).Methods("GET", "OPTIONS")
|
||||
|
||||
//
|
||||
mux.HandleFunc("/v1/approvals", s.approvalsHandler).Methods("GET", "OPTIONS")
|
||||
|
||||
// native webhooks handler
|
||||
mux.HandleFunc("/v1/webhooks/native", s.nativeHandler).Methods("POST", "OPTIONS")
|
||||
|
||||
|
|
Loading…
Reference in New Issue