]> Untitled Git - lemmy.git/blobdiff - crates/api_structs/src/post.rs
Use URL type in most outstanding struct fields (#1468)
[lemmy.git] / crates / api_structs / src / post.rs
index 4e2011e91dbaaf63b4662c889959e9aa1e20c8d9..82be66170d9aa65b8dfc17a0dba074de9ad88125 100644 (file)
@@ -8,11 +8,12 @@ use lemmy_db_views_actor::{
   community_view::CommunityView,
 };
 use serde::{Deserialize, Serialize};
+use url::Url;
 
 #[derive(Deserialize, Debug)]
 pub struct CreatePost {
   pub name: String,
-  pub url: Option<String>,
+  pub url: Option<Url>,
   pub body: Option<String>,
   pub nsfw: bool,
   pub community_id: i32,
@@ -66,7 +67,7 @@ pub struct CreatePostLike {
 pub struct EditPost {
   pub post_id: i32,
   pub name: String,
-  pub url: Option<String>,
+  pub url: Option<Url>,
   pub body: Option<String>,
   pub nsfw: bool,
   pub auth: String,