Skip to content

Commit

Permalink
Merge pull request #1946 from stakwork/feat/stories_webhook_logs
Browse files Browse the repository at this point in the history
PR: Aded logs to feature stories webhook
  • Loading branch information
elraphty authored Nov 13, 2024
2 parents 92d3fa2 + fb92c22 commit 567f321
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 567f321

Please sign in to comment.