mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 00:26:31 -06:00
fix: normalize camelCase serialization for project API fields, request serialization casing
This commit is contained in:
+10
-2
@@ -50,9 +50,9 @@ pub struct ApiAdminProject {
|
||||
pub tags: Vec<ApiTag>,
|
||||
pub status: 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>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(rename = "demoUrl", skip_serializing_if = "Option::is_none")]
|
||||
pub demo_url: Option<String>,
|
||||
#[serde(rename = "createdAt")]
|
||||
pub created_at: String, // ISO 8601
|
||||
@@ -114,11 +114,15 @@ impl DbProject {
|
||||
pub struct CreateProjectRequest {
|
||||
pub name: String,
|
||||
pub slug: Option<String>,
|
||||
#[serde(rename = "shortDescription")]
|
||||
pub short_description: String,
|
||||
pub description: String,
|
||||
pub status: ProjectStatus,
|
||||
#[serde(rename = "githubRepo")]
|
||||
pub github_repo: Option<String>,
|
||||
#[serde(rename = "demoUrl")]
|
||||
pub demo_url: Option<String>,
|
||||
#[serde(rename = "tagIds")]
|
||||
pub tag_ids: Vec<String>, // UUID strings
|
||||
}
|
||||
|
||||
@@ -126,11 +130,15 @@ pub struct CreateProjectRequest {
|
||||
pub struct UpdateProjectRequest {
|
||||
pub name: String,
|
||||
pub slug: Option<String>,
|
||||
#[serde(rename = "shortDescription")]
|
||||
pub short_description: String,
|
||||
pub description: String,
|
||||
pub status: ProjectStatus,
|
||||
#[serde(rename = "githubRepo")]
|
||||
pub github_repo: Option<String>,
|
||||
#[serde(rename = "demoUrl")]
|
||||
pub demo_url: Option<String>,
|
||||
#[serde(rename = "tagIds")]
|
||||
pub tag_ids: Vec<String>, // UUID strings
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,17 @@
|
||||
});
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
// Initialize theme store
|
||||
themeStore.init();
|
||||
|
||||
Reference in New Issue
Block a user