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
This commit is contained in:
parent
1e914089d5
commit
3a6bcbd94d
5 changed files with 25 additions and 20 deletions
|
|
@ -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
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue