mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
🎉 Enable comments events on webhooks
This commit is contained in:
parent
d7459db292
commit
782f2ed57d
1 changed files with 8 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
|
[app.loggers.webhooks :as-alias webhooks]
|
||||||
[app.rpc.commands.files :as files]
|
[app.rpc.commands.files :as files]
|
||||||
[app.rpc.doc :as-alias doc]
|
[app.rpc.doc :as-alias doc]
|
||||||
[app.rpc.queries.teams :as teams]
|
[app.rpc.queries.teams :as teams]
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
#(or (:file-id %) (:team-id %))))
|
#(or (:file-id %) (:team-id %))))
|
||||||
|
|
||||||
(sv/defmethod ::get-comment-threads
|
(sv/defmethod ::get-comment-threads
|
||||||
|
{::doc/added "1.15"}
|
||||||
[{:keys [pool] :as cfg} params]
|
[{:keys [pool] :as cfg} params]
|
||||||
(with-open [conn (db/open pool)]
|
(with-open [conn (db/open pool)]
|
||||||
(retrieve-comment-threads conn params)))
|
(retrieve-comment-threads conn params)))
|
||||||
|
@ -245,7 +247,8 @@
|
||||||
(sv/defmethod ::create-comment-thread
|
(sv/defmethod ::create-comment-thread
|
||||||
{::retry/max-retries 3
|
{::retry/max-retries 3
|
||||||
::retry/matches retry/conflict-db-insert?
|
::retry/matches retry/conflict-db-insert?
|
||||||
::doc/added "1.15"}
|
::doc/added "1.15"
|
||||||
|
::webhooks/event? true}
|
||||||
[{:keys [pool] :as cfg} {:keys [profile-id file-id share-id] :as params}]
|
[{:keys [pool] :as cfg} {:keys [profile-id file-id share-id] :as params}]
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(files/check-comment-permissions! conn profile-id file-id share-id)
|
(files/check-comment-permissions! conn profile-id file-id share-id)
|
||||||
|
@ -364,7 +367,8 @@
|
||||||
:opt-un [::share-id]))
|
:opt-un [::share-id]))
|
||||||
|
|
||||||
(sv/defmethod ::create-comment
|
(sv/defmethod ::create-comment
|
||||||
{::doc/added "1.15"}
|
{::doc/added "1.15"
|
||||||
|
::webhooks/event? true}
|
||||||
[{:keys [pool] :as cfg} params]
|
[{:keys [pool] :as cfg} params]
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(create-comment conn params)))
|
(create-comment conn params)))
|
||||||
|
@ -483,7 +487,8 @@
|
||||||
(s/keys :req-un [::profile-id ::id]))
|
(s/keys :req-un [::profile-id ::id]))
|
||||||
|
|
||||||
(sv/defmethod ::delete-comment
|
(sv/defmethod ::delete-comment
|
||||||
{::doc/added "1.15"}
|
{::doc/added "1.15"
|
||||||
|
::webhooks/event? true}
|
||||||
[{:keys [pool] :as cfg} {:keys [profile-id id] :as params}]
|
[{:keys [pool] :as cfg} {:keys [profile-id id] :as params}]
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(let [comment (db/get-by-id conn :comment id {:for-update true})]
|
(let [comment (db/get-by-id conn :comment id {:for-update true})]
|
||||||
|
@ -529,4 +534,3 @@
|
||||||
:frame-id frame-id}
|
:frame-id frame-id}
|
||||||
{:id (:id thread)})
|
{:id (:id thread)})
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue