Skip to content

Commit

Permalink
fix return logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushgaud committed Nov 15, 2023
1 parent bbb7c40 commit 595130e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/wrike_ist/wrike.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@
(fn [resolve reject]
(.info js/console "check-valid-task: Start of the function")
(when (and target-branch (str/starts-with? target-branch "main"))
(let [task-in-folder? (is-wrike-task-in-folder? permalink)]
(if (task-in-folder?)
(do
(.info js/console "check-valid-task: Task is in the folder or an inherited folder: true")
(resolve permalink))
(do
(.error js/console "check-valid-task: Task not found in folder")
(reject (js/Error. "check-valid-task: Task not found in folder")))))))))
(let [task-in-folder-promise (is-wrike-task-in-folder? permalink)]
(.then task-in-folder-promise
(fn [task-in-folder?]
(if task-in-folder?
(do
(.info js/console "check-valid-task: Task is in the folder or an inherited folder: true")
(resolve permalink))
(do
(.error js/console "check-valid-task: Task not found in folder")
(reject (js/Error. "check-valid-task: Task not found in folder")))))))))))

(defn link-pr
[{:keys [pr-url permalink] :as details}]
Expand Down

0 comments on commit 595130e

Please sign in to comment.