X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapi%2Fsrc%2Flocal_user%2Fnotifications%2Fmark_reply_read.rs;h=e270d5470f0754ce49cbce2e991141cdf6d63b5d;hb=235cc8b22897bfb3e71ba3dbd725d36863fea8ba;hp=3e502f39c5d0e6b1122612caf42c7528ab57b413;hpb=276a8c2bd3e4fd1323e66b808675cf14cf6f75c5;p=lemmy.git diff --git a/crates/api/src/local_user/notifications/mark_reply_read.rs b/crates/api/src/local_user/notifications/mark_reply_read.rs index 3e502f39..e270d547 100644 --- a/crates/api/src/local_user/notifications/mark_reply_read.rs +++ b/crates/api/src/local_user/notifications/mark_reply_read.rs @@ -4,7 +4,10 @@ use lemmy_api_common::{ person::{CommentReplyResponse, MarkCommentReplyAsRead}, utils::{blocking, get_local_user_view_from_jwt}, }; -use lemmy_db_schema::{source::comment_reply::CommentReply, traits::Crud}; +use lemmy_db_schema::{ + source::comment_reply::{CommentReply, CommentReplyUpdateForm}, + traits::Crud, +}; use lemmy_db_views_actor::structs::CommentReplyView; use lemmy_utils::{error::LemmyError, ConnectionId}; use lemmy_websocket::LemmyContext; @@ -34,11 +37,12 @@ impl Perform for MarkCommentReplyAsRead { } let comment_reply_id = read_comment_reply.id; - let read = data.read; - let update_reply = move |conn: &mut _| CommentReply::update_read(conn, comment_reply_id, read); - blocking(context.pool(), update_reply) - .await? - .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_comment"))?; + let read = Some(data.read); + blocking(context.pool(), move |conn| { + CommentReply::update(conn, comment_reply_id, &CommentReplyUpdateForm { read }) + }) + .await? + .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_comment"))?; let comment_reply_id = read_comment_reply.id; let person_id = local_user_view.person.id;