route to remove bot confirmation in case of error on confirm payout
This commit is contained in:
parent
2aa751769a
commit
9a5386a5fa
|
@ -428,6 +428,12 @@ UPDATE issues
|
|||
SET is_open = :is_open
|
||||
WHERE issue_id = :issue_id;
|
||||
|
||||
-- :name reset-bot-confirmation :! :n
|
||||
-- :doc updates issue's execute and confirm hash
|
||||
UPDATE issues
|
||||
SET execute_hash = NULL,
|
||||
confirm_hash = NULL
|
||||
WHERE issue_id = :issue_id;
|
||||
|
||||
-- :name issue-exists :1
|
||||
-- :doc returns true if given issue exists
|
||||
|
|
|
@ -95,6 +95,12 @@
|
|||
(db/update-issue-open con-db {:issue_id issue-id
|
||||
:is_open is-open})))
|
||||
|
||||
(defn reset-bot-confirmation
|
||||
"resets execute and confirm hash to null for given issue id"
|
||||
[issue-id]
|
||||
(jdbc/with-db-connection [con-db *db*]
|
||||
(db/reset-bot-confirmation con-db {:issue_id issue-id})))
|
||||
|
||||
(defn is-bounty-issue?
|
||||
[issue-id]
|
||||
(let [res (jdbc/with-db-connection [con-db *db*]
|
||||
|
|
|
@ -266,4 +266,12 @@
|
|||
(ok {:issue-id issue-id
|
||||
:execute-hash execute-hash
|
||||
:contract-address contract-address})
|
||||
(bad-request (str "Unable to withdraw funds from " contract-address)))))))))
|
||||
(bad-request (str "Unable to withdraw funds from " contract-address))))))
|
||||
(POST "/remove-bot-confirmation" {{issue-id :issue-id} :params}
|
||||
:auth-rules authenticated?
|
||||
:current-user user
|
||||
(do (log/infof "calling remove-bot-confirmation for %s " issue-id)
|
||||
;; if this resulted in updating a row, return success
|
||||
(if (pos? (issues/reset-bot-confirmation issue-id))
|
||||
(ok (str "Updated execute and confirm hash for " issue-id))
|
||||
(bad-request (str "Unable to update execute and confirm hash for " issue-id))))))))
|
||||
|
|
Loading…
Reference in New Issue