Fix MongoDB DateTime serialization issues - Replace chrono::DateTime with mongodb::bson::DateTime in models - Update API responses to use timestamp_millis() for JSON serialization - Fix User, Share model DateTime fields - Update all handler responses to return i64 timestamps - This fixes the Kind: invalid type: map, expected RFC 3339 error
Some checks failed
Lint and Build / Lint (push) Failing after 5s
Lint and Build / Build (push) Has been skipped
Lint and Build / Docker Build (push) Has been skipped

This commit is contained in:
goose 2026-02-26 09:22:36 -03:00
parent 1e914089d5
commit 3a6bcbd94d
5 changed files with 25 additions and 20 deletions

View file

@ -9,10 +9,13 @@ pub async fn health_check(State(state): State<AppState>) -> Json<Value> {
"error"
};
// Use timestamp_millis for consistency with other endpoints
let timestamp = mongodb::bson::DateTime::now().timestamp_millis();
Json(json!({
"status": "ok",
"database": status,
"timestamp": chrono::Utc::now().to_rfc3339()
"timestamp": timestamp
}))
}