summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--makima/src/db/repository.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs
index 9a1bf2d..83bcbcd 100644
--- a/makima/src/db/repository.rs
+++ b/makima/src/db/repository.rs
@@ -2163,7 +2163,10 @@ pub async fn create_template_for_owner(
.bind(&req.description)
.bind(serde_json::to_value(&req.phases).unwrap_or_default())
.bind(&req.default_phase)
- .bind(req.deliverables.as_ref().map(|d| serde_json::to_value(d).unwrap_or_default()))
+ .bind(match &req.deliverables {
+ Some(d) => serde_json::to_value(d).ok(),
+ None => None,
+ })
.fetch_one(pool)
.await
}