fix: normalize camelCase serialization for project API fields, request serialization casing

This commit is contained in:
2026-01-14 09:50:13 -06:00
parent c78fd44ccd
commit 4299f65665
2 changed files with 21 additions and 4 deletions
+10 -2
View File
@@ -50,9 +50,9 @@ pub struct ApiAdminProject {
pub tags: Vec<ApiTag>, pub tags: Vec<ApiTag>,
pub status: String, pub status: String,
pub description: String, pub description: String,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "githubRepo", skip_serializing_if = "Option::is_none")]
pub github_repo: Option<String>, pub github_repo: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "demoUrl", skip_serializing_if = "Option::is_none")]
pub demo_url: Option<String>, pub demo_url: Option<String>,
#[serde(rename = "createdAt")] #[serde(rename = "createdAt")]
pub created_at: String, // ISO 8601 pub created_at: String, // ISO 8601
@@ -114,11 +114,15 @@ impl DbProject {
pub struct CreateProjectRequest { pub struct CreateProjectRequest {
pub name: String, pub name: String,
pub slug: Option<String>, pub slug: Option<String>,
#[serde(rename = "shortDescription")]
pub short_description: String, pub short_description: String,
pub description: String, pub description: String,
pub status: ProjectStatus, pub status: ProjectStatus,
#[serde(rename = "githubRepo")]
pub github_repo: Option<String>, pub github_repo: Option<String>,
#[serde(rename = "demoUrl")]
pub demo_url: Option<String>, pub demo_url: Option<String>,
#[serde(rename = "tagIds")]
pub tag_ids: Vec<String>, // UUID strings pub tag_ids: Vec<String>, // UUID strings
} }
@@ -126,11 +130,15 @@ pub struct CreateProjectRequest {
pub struct UpdateProjectRequest { pub struct UpdateProjectRequest {
pub name: String, pub name: String,
pub slug: Option<String>, pub slug: Option<String>,
#[serde(rename = "shortDescription")]
pub short_description: String, pub short_description: String,
pub description: String, pub description: String,
pub status: ProjectStatus, pub status: ProjectStatus,
#[serde(rename = "githubRepo")]
pub github_repo: Option<String>, pub github_repo: Option<String>,
#[serde(rename = "demoUrl")]
pub demo_url: Option<String>, pub demo_url: Option<String>,
#[serde(rename = "tagIds")]
pub tag_ids: Vec<String>, // UUID strings pub tag_ids: Vec<String>, // UUID strings
} }
+10 -1
View File
@@ -61,8 +61,17 @@
}); });
onMount(() => { onMount(() => {
// Randomly choose background component (50/50 chance) // Detect if this is a page reload (F5 or CTRL+F5) vs initial load or SPA navigation
const navigation = performance.getEntriesByType(
"navigation",
)[0] as PerformanceNavigationTiming;
const isReload = navigation?.type === "reload";
// Randomize on reload OR if not yet set (initial load)
// SPA navigation doesn't trigger onMount, so background stays stable
if (isReload || backgroundComponent === null) {
backgroundComponent = Math.random() < 0.5 ? "clouds" : "dots"; backgroundComponent = Math.random() < 0.5 ? "clouds" : "dots";
}
// Initialize theme store // Initialize theme store
themeStore.init(); themeStore.init();