summaryrefslogtreecommitdiff
path: root/src/db/story.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2024-11-07 17:06:03 +0100
committerWriterV2 <primary-v2@protonmail.com>2024-11-07 17:06:31 +0100
commit99fc959383d5b7b26d8e80f6257adf8b98989f41 (patch)
treea12795706e7a0dee188ea0339656807aeda5243a /src/db/story.rs
parent696af52b9b3a732b369a771e1f6409d8e2049ea9 (diff)
Feat: Add ability to add tags to story (and product in general)
Diffstat (limited to 'src/db/story.rs')
-rw-r--r--src/db/story.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/db/story.rs b/src/db/story.rs
index b77d7a3..137c964 100644
--- a/src/db/story.rs
+++ b/src/db/story.rs
@@ -78,12 +78,13 @@ impl ProductDatabaseHandler for Story {
pool: &SqlitePool,
name: String,
description: String,
+ tags: Vec<String>,
) -> Result<Self, AppError>
where
Self: Sized,
{
let mut tx = pool.begin().await?;
- let product = Product::post(&mut tx, name, description).await?;
+ let product = Product::post(&mut tx, name, description, tags).await?;
let story = sqlx::query_as!(
Story,
"INSERT INTO story (language, pdf, epub, pid) VALUES ($1, $2, $3, $4) RETURNING id, language, pdf, epub, pid",