mirror of
https://github.com/logseq/logseq.git
synced 2026-05-28 14:39:48 +00:00
enhance(rtc): grant access api support emails
This commit is contained in:
@@ -636,13 +636,14 @@
|
||||
|
||||
|
||||
(defn <grant-graph-access-to-others
|
||||
[state graph-uuid target-user-uuids]
|
||||
[state graph-uuid & {:keys [target-user-uuids target-user-emails]}]
|
||||
(go
|
||||
(let [r (with-sub-data-from-ws state
|
||||
(<! (ws/<send! state {:req-id (get-req-id)
|
||||
:action "grant-access"
|
||||
:graph-uuid graph-uuid
|
||||
:target-user-uuids target-user-uuids}))
|
||||
:target-user-uuids target-user-uuids
|
||||
:target-user-emails target-user-emails}))
|
||||
|
||||
(<! (get-result-ch)))]
|
||||
(when-let [ex-message (:ex-message r)]
|
||||
|
||||
@@ -141,16 +141,20 @@
|
||||
{:class "mr-2"
|
||||
:on-click (fn []
|
||||
(go
|
||||
(when-let [user-uuid (some-> @(::grant-access-to-user state) parse-uuid)]
|
||||
(let [user-uuid (some-> @(::grant-access-to-user state) parse-uuid)
|
||||
user-email (when-not user-uuid @(::grant-access-to-user state))]
|
||||
(when-let [graph-uuid @(::graph-uuid state)]
|
||||
(<! (rtc-core/<grant-graph-access-to-others s graph-uuid [user-uuid]))))))})
|
||||
(<! (rtc-core/<grant-graph-access-to-others
|
||||
s graph-uuid
|
||||
:target-user-uuids [user-uuid]
|
||||
:target-user-emails [user-email]))))))})
|
||||
|
||||
[:input.form-input.my-2
|
||||
{:on-change (fn [e] (reset! (::grant-access-to-user state) (util/evalue e)))
|
||||
:on-focus (fn [e] (let [v (.-value (.-target e))]
|
||||
(when (= v "input user-uuid here")
|
||||
(when (= v "input email or user-uuid here")
|
||||
(set! (.-value (.-target e)) ""))))
|
||||
:default-value "input user-uuid here"}]])
|
||||
:default-value "input email or user-uuid here"}]])
|
||||
[:hr]
|
||||
[:div.flex.flex-row
|
||||
(ui/button (str "download graph to")
|
||||
|
||||
Reference in New Issue
Block a user