diff options
| -rw-r--r-- | src/admin.clj | 18 | ||||
| -rwxr-xr-x | src/utils.clj | 3 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/admin.clj b/src/admin.clj index 9dbc65c..3593072 100644 --- a/src/admin.clj +++ b/src/admin.clj @@ -130,15 +130,15 @@ AND cancelled = false (cond (not mute) (resp-error "INVALID_MUTE_ID") (not active) (resp-error "EXPIRED_MUTE") (not reason) (resp-error "NO_REASON") - :else (assert-update - (do-update :mutes [qry mute-id] - {:cancelled true - :cancel_admin_id admin-id - :cancel_reason reason}) - (do - (update! *active-mutes*) - (resp-success "OK")) - (resp-error "UPDATE_ERROR"))))) + :else (if (assert-update + (do-update :mutes [qry mute-id] + {:cancelled true + :cancel_admin_id admin-id + :cancel_reason reason})) + (do + (update! *active-mutes*) + (resp-success "OK")) + (resp-error "UPDATE_ERROR"))))) (defn handle-cancel-mute! [session params] (if-vip diff --git a/src/utils.clj b/src/utils.clj index ee64789..25814f9 100755 --- a/src/utils.clj +++ b/src/utils.clj @@ -269,8 +269,7 @@ (insert-values table cols values))) (defn assert-update - ([res ok err] (if (not (= (first res) 1)) err ok)) - ([res] (assert-update res true false))) + ([res] (= (first res) 1))) (defn sql-array [type arr] (with-connection *db* |
