Mark all notifications as read from dashboard (#5805)

*  Mark all notifications as read from dashboard

* ♻️ Mark all notifications as read code review

* ♻️ Mark all notifications as read code review II
This commit is contained in:
María Valderrama 2025-02-14 11:48:24 +01:00 committed by GitHub
parent 8a332c1402
commit 59a57d6c3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 64 additions and 2 deletions

View file

@ -797,3 +797,18 @@
{:id id}
{::db/return-keys false})
nil))
(def ^:private
schema:mark-all-threads-as-read
[:map {:title "mark-all-threads-as-read"}
[:threads [:vector ::sm/uuid]]])
(sv/defmethod ::mark-all-threads-as-read
{::doc/added "1.15"
::sm/params schema:mark-all-threads-as-read}
[cfg {:keys [::rpc/profile-id threads] :as params}]
(db/tx-run!
cfg
(fn [{:keys [::db/conn]}]
(doseq [thread-id threads]
(upsert-comment-thread-status! conn profile-id thread-id)))))