]> Untitled Git - lemmy.git/blobdiff - crates/db_queries/src/source/post.rs
Use Url type for ap_id fields in database (fixes #1364)
[lemmy.git] / crates / db_queries / src / source / post.rs
index bca848cad2af96369aa0d0841053d6e75703fc96..7816d4a11e9d12afef3d65fa798549893eee66aa 100644 (file)
@@ -12,6 +12,7 @@ use lemmy_db_schema::{
     PostSaved,
     PostSavedForm,
   },
+  Url,
 };
 
 impl Crud<PostForm> for Post {
@@ -146,7 +147,7 @@ impl Post_ for Post {
 }
 
 impl ApubObject<PostForm> for Post {
-  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::post::dsl::*;
     post.filter(ap_id.eq(object_id)).first::<Self>(conn)
   }