Advertisement
_eremec_

Untitled

Jun 1st, 2019
1,308
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defmethod -event-msg-handler :project/add-message
  2.   [{:keys [?data ring-req uid]}]
  3.  
  4.   (RECEIVE ?data uid ring-req
  5.            save-message!
  6.            :rules [authenticated?
  7.                    chat-participant?]
  8.            :params project.routes.services.ws.schemas/SaveMessageArgs
  9.            :return SaveMessageReturn
  10.            :on-response
  11.  
  12.            [#(SEND % uid :chat/add-message
  13.                    update-chat-add
  14.                    :return UpdateChatAddReturn)]))
  15.  
  16. (defmethod -event-msg-handler :project/add-request
  17.   [{:keys [?data ring-req uid]}]
  18.  
  19.   (RECEIVE ?data uid ring-req
  20.            save-request!
  21.            :rules [authenticated?
  22.                    (fn [?data ring-req] (not (send-request-errors ?data)))]
  23.            :params SaveRequestArgs
  24.            :return SaveRequestReturn
  25.            :on-response
  26.  
  27.            [#(SEND % uid :monitor/add-request
  28.                    monitor-add-request
  29.                    :return MonitorAddRequestReturn)
  30.  
  31.             #(SEND % uid :user-requests/add-request
  32.                    user-requests-add-request
  33.                    :return UserRequestsAddRequestReturn)]))
Advertisement
RAW Paste Data Copied
Advertisement