paste: Make is_url an optional parameter in JSON body
Signed-off-by: ATechnoHazard <amolele@gmail.com>
This commit is contained in:
3 files changed
+3
-3
No files matched your search
@@ -5,6 +5,6 @@ use crate::schema::pastes;
|
||||
pub struct Paste {
|
||||
pub id: Option<String>,
|
||||
pub belongs_to: Option<String>,
|
||||
pub is_url: bool,
|
||||
pub is_url: Option<bool>,
|
||||
pub content: String,
|
||||
}
|
||||
@@ -5,7 +5,7 @@ use super::entity::Paste;
|
||||
use super::postgres;
|
||||
|
||||
pub fn create_paste(paste: &mut Paste, conn: &PgConnection) -> Result<usize> {
|
||||
paste.is_url = validator::validate_url(paste.content.clone());
|
||||
paste.is_url = Some(validator::validate_url(paste.content.clone()));
|
||||
postgres::create_paste(paste, conn)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user