-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete organisation #15
Conversation
f9f7173
to
917f1d6
Compare
([user-id org-id] | ||
(get-permission (config/db-spec) user-id org-id)) | ||
([conn user-id org-id] | ||
(-> (jdbc/query conn (-> (h/select :permission) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jdbc/find-by-keys
?
(jdbc/with-db-transaction [trn (config/db-spec)] | ||
(if (is-owner? trn id user-id) | ||
(if-not (empty? (db/delete! trn id)) | ||
{:success "Organisation deleted"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the else section is missing here, this returns nil
. Is that okay?
|
||
(defn show-alert-bottom | ||
[status message & [time]] | ||
(let [time (if (number? time) (* time 1000) 4000)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
number?
seems like the wrong check here. are you checking for presence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking if time is a number and is not nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine.
Note: Raised against #12 for reviews only. Change base to master before merge.