diff --git a/sql/articles/update.sql b/sql/articles/update.sql index 34f3554..928723c 100644 --- a/sql/articles/update.sql +++ b/sql/articles/update.sql @@ -6,12 +6,13 @@ UPDATE articles SET text_type = $5, updated_at = NOW(), tags = $6, - is_published = $7 + is_published = $7, + marked_as_done = $8 FROM creators WHERE articles.author = creators.username AND - id = $8 + id = $9 RETURNING id, title, diff --git a/src/api/text/mod.rs b/src/api/text/mod.rs index b1106ea..3527ebc 100644 --- a/src/api/text/mod.rs +++ b/src/api/text/mod.rs @@ -94,6 +94,7 @@ pub async fn text_edit( form.text_type, &tags, should_publish, + form.marked_as_done, ) .await?; diff --git a/src/database/models/article.rs b/src/database/models/article.rs index 68eb44b..b94bc11 100644 --- a/src/database/models/article.rs +++ b/src/database/models/article.rs @@ -135,6 +135,7 @@ impl Text { text_type: TextType, tags: &Vec, is_published: bool, + marked_as_done: bool, ) -> Result { sqlx::query_file_as!( Self, @@ -146,6 +147,7 @@ impl Text { text_type as TextType, tags, is_published, + marked_as_done, id, ) .fetch_one(&db.pool)