fix: more deviations from spec fixed

This commit is contained in:
2026-04-05 08:57:02 +02:00
parent 75cb19a604
commit ac2afc7d50
17 changed files with 161 additions and 67 deletions

View File

@@ -43,8 +43,8 @@ pub fn create_post(
template_slug: Option<&str>,
) -> EngineResult<Post> {
let id = Uuid::new_v4().to_string();
let raw_title = if title.is_empty() { "untitled" } else { title };
let base_slug = slugify(raw_title);
let slug_source = if title.is_empty() { "untitled" } else { title };
let base_slug = slugify(slug_source);
let base_slug = if base_slug.is_empty() {
"untitled".to_string()
} else {
@@ -58,7 +58,7 @@ pub fn create_post(
let post = Post {
id,
project_id: project_id.to_string(),
title: raw_title.to_string(),
title: title.to_string(),
slug,
excerpt: None,
content: content.map(|s| s.to_string()),
@@ -341,6 +341,12 @@ pub fn delete_post(
params![post_id],
)?;
// Delete post-media associations
conn.execute(
"DELETE FROM post_media WHERE post_id = ?1",
params![post_id],
)?;
// Remove from FTS
fts::remove_post_from_index(conn, post_id)?;