Skip to content

Commit 27a0c27

Browse files
authored
Merge pull request #1241 from circleci/fix-test-webhook-button-for-bb-projects
Make test webhook button work for BB projects
2 parents 1d4018e + d5b0f57 commit 27a0c27

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src-cljs/frontend/api/path.cljs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@
8383
(gstring/format "%s/invite"
8484
(base-organization-url-path vcs-type org-name)))
8585

86+
(defn project-hook-test [vcs-type project-name service-name]
87+
(gstring/format
88+
"%s/%s/hooks/%s/test"
89+
(base-project-url-path vcs-type)
90+
project-name
91+
service-name))
92+
8693
(defn build-retry [vcs-type org-name repo-name build-num]
8794
(gstring/format
8895
"%s/%s/%s/%s/retry"

src-cljs/frontend/controllers/controls.cljs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,12 +773,15 @@
773773
[target message {:keys [project-id merge-paths service]} previous-state current-state]
774774
(let [uuid frontend.async/*uuid*
775775
project-name (vcs-url/project-name project-id)
776+
vcs-type (vcs-url/vcs-type project-id)
776777
comms (get-in current-state [:comms])]
777778
(go
778779
(let [save-result (<! (save-project-settings project-id merge-paths current-state))
779780
test-result (if (= (:status save-result) :success)
780-
(let [test-result (<! (ajax/managed-ajax :post (gstring/format "/api/v1/project/%s/hooks/%s/test" project-name service)
781-
:params {:project-id project-id}))]
781+
(let [test-result
782+
(<! (ajax/managed-ajax
783+
:post (api-path/project-hook-test vcs-type project-name service)
784+
:params {:project-id project-id}))]
782785
(when (not= (:status test-result) :success)
783786
(put! (:errors comms) [:api-error test-result]))
784787
test-result)

0 commit comments

Comments
 (0)