show 'Owned' list in lists table. prevent certain operations on it
This commit is contained in:
parent
2cf7a11c7b
commit
62cdd59d45
|
@ -17,18 +17,22 @@
|
|||
|
||||
(defn remove-list!
|
||||
[list-id]
|
||||
(vexec! view-system db
|
||||
["delete from lists
|
||||
(if (= 0 list-id)
|
||||
(throw (Exception. "Cannot remove the 'Owned' list."))
|
||||
(vexec! view-system db
|
||||
["delete from lists
|
||||
where id = ?"
|
||||
(int list-id)]))
|
||||
(int list-id)])))
|
||||
|
||||
(defn update-list-name!
|
||||
[list-id name]
|
||||
(vexec! view-system db
|
||||
["update lists
|
||||
(if (= 0 list-id)
|
||||
(throw (Exception. "Cannot change the name of the 'Owned' list."))
|
||||
(vexec! view-system db
|
||||
["update lists
|
||||
set name = ?
|
||||
where id = ?"
|
||||
(str name) (int list-id)]))
|
||||
(str name) (int list-id)])))
|
||||
|
||||
(defn update-list-note!
|
||||
[list-id note]
|
||||
|
@ -40,8 +44,10 @@
|
|||
|
||||
(defn update-list-visibility!
|
||||
[list-id public?]
|
||||
(vexec! view-system db
|
||||
["update lists
|
||||
(if (= 0 list-id)
|
||||
(throw (Exception. "Cannot change the visibility of the 'Owned' list."))
|
||||
(vexec! view-system db
|
||||
["update lists
|
||||
set is_public = ?
|
||||
where id = ?"
|
||||
(boolean public?) (int list-id)]))
|
||||
(boolean public?) (int list-id)])))
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
where lc.list_id = l.id
|
||||
) as num_cards
|
||||
from lists l
|
||||
where l.id != 0
|
||||
and l.is_public in (true, ?)
|
||||
where l.is_public in (true, ?)
|
||||
order by l.name"
|
||||
public-only?]))
|
||||
|
||||
|
@ -44,7 +43,6 @@
|
|||
(let [public-only? (nil? user-id)]
|
||||
["select id, name
|
||||
from lists
|
||||
where id != 0
|
||||
and is_public in (true, ?)
|
||||
where is_public in (true, ?)
|
||||
order by name"
|
||||
public-only?]))
|
||||
|
|
Loading…
Reference in a new issue