]> Untitled Git - lemmy.git/blobdiff - crates/db_queries/src/source/comment.rs
Use Url type for ap_id fields in database (fixes #1364)
[lemmy.git] / crates / db_queries / src / source / comment.rs
index 6e99bf36e2fad795b2c0b51c284e49acb8c79261..28d52e89c316ed38e97860ff44732bfed5205b0b 100644 (file)
@@ -10,6 +10,7 @@ use lemmy_db_schema::{
     CommentSaved,
     CommentSavedForm,
   },
+  Url,
 };
 
 pub trait Comment_ {
@@ -144,7 +145,7 @@ impl Crud<CommentForm> for Comment {
 }
 
 impl ApubObject<CommentForm> for Comment {
-  fn read_from_apub_id(conn: &PgConnection, object_id: &str) -> Result<Self, Error> {
+  fn read_from_apub_id(conn: &PgConnection, object_id: &Url) -> Result<Self, Error> {
     use lemmy_db_schema::schema::comment::dsl::*;
     comment.filter(ap_id.eq(object_id)).first::<Self>(conn)
   }