]> Untitled Git - lemmy.git/commitdiff
Fixing updated form fields. Fixes #2724 (#2725)
authorDessalines <dessalines@users.noreply.github.com>
Tue, 14 Feb 2023 21:41:22 +0000 (16:41 -0500)
committerGitHub <noreply@github.com>
Tue, 14 Feb 2023 21:41:22 +0000 (16:41 -0500)
* Fixing updated form fields. Fixes #2724

* Fix import.

crates/api_crud/src/comment/update.rs
crates/api_crud/src/community/update.rs
crates/api_crud/src/post/update.rs

index 88de41158ea44863992c69172f69421938cdb715..27d65cbe86ff4aeb93379d768c9404c9c2b143b2 100644 (file)
@@ -23,6 +23,7 @@ use lemmy_db_schema::{
     local_site::LocalSite,
   },
   traits::Crud,
+  utils::naive_now,
 };
 use lemmy_db_views::structs::CommentView;
 use lemmy_utils::{
@@ -92,6 +93,7 @@ impl PerformCrud for EditComment {
       .content(content_slurs_removed)
       .distinguished(data.distinguished)
       .language_id(data.language_id)
+      .updated(Some(Some(naive_now())))
       .build();
     let updated_comment = Comment::update(context.pool(), comment_id, &form)
       .await
index 9059a4a6f636ac5e490ca8d0e1e72e145e11d1d0..6ab161070650772379068a289399e80d40e2a074 100644 (file)
@@ -14,7 +14,7 @@ use lemmy_db_schema::{
     local_site::LocalSite,
   },
   traits::Crud,
-  utils::{diesel_option_overwrite, diesel_option_overwrite_to_url},
+  utils::{diesel_option_overwrite, diesel_option_overwrite_to_url, naive_now},
 };
 use lemmy_db_views_actor::structs::CommunityModeratorView;
 use lemmy_utils::{error::LemmyError, utils::check_slurs_opt, ConnectionId};
@@ -70,6 +70,7 @@ impl PerformCrud for EditCommunity {
       .banner(banner)
       .nsfw(data.nsfw)
       .posting_restricted_to_mods(data.posting_restricted_to_mods)
+      .updated(Some(Some(naive_now())))
       .build();
 
     let community_id = data.community_id;
index 9337c595271c90e32ce8c0afd840270bdff70acf..ecb9bf08bf20dd7e00df77a7ee305420d241e5cf 100644 (file)
@@ -19,7 +19,7 @@ use lemmy_db_schema::{
     post::{Post, PostUpdateForm},
   },
   traits::Crud,
-  utils::diesel_option_overwrite,
+  utils::{diesel_option_overwrite, naive_now},
 };
 use lemmy_utils::{
   error::LemmyError,
@@ -101,6 +101,7 @@ impl PerformCrud for EditPost {
       .embed_video_url(embed_video_url)
       .language_id(data.language_id)
       .thumbnail_url(Some(thumbnail_url))
+      .updated(Some(Some(naive_now())))
       .build();
 
     let post_id = data.post_id;