Skip to content

Commit

Permalink
aded logs to webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Nov 13, 2024
1 parent 92d3fa2 commit fb92c22
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions handlers/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,18 @@ func (oh *featureHandler) GetFeatureStories(w http.ResponseWriter, r *http.Reque

featureUuid := featureStories.Output.FeatureUuid

log.Println("Webhook Feature Uuid", featureUuid)

if err != nil {
w.WriteHeader(http.StatusNotAcceptable)
fmt.Fprintf(w, "Error decoding request body: %v", err)
log.Printf("Error decoding request body: %v", err)
return
}

log.Panicf("Webhook Feature Output", featureStories.Output)

log.Println("Webhook Feature Stories === ", featureStories.Output.Stories)

for _, story := range featureStories.Output.Stories {
// check if feature story exists
feature := oh.db.GetFeatureByUuid(featureUuid)
Expand All @@ -460,7 +466,7 @@ func (oh *featureHandler) GetFeatureStories(w http.ResponseWriter, r *http.Reque
}

w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode("User stories added successfuly")
json.NewEncoder(w).Encode("User stories added successfully")
}

func (oh *featureHandler) StoriesSend(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit fb92c22

Please sign in to comment.