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

@ -20,8 +20,8 @@ pub struct UserProfileResponse {
pub id: String,
pub email: String,
pub username: String,
pub created_at: String,
pub last_active: String,
pub created_at: i64,
pub last_active: i64,
pub email_verified: bool,
}
@ -33,8 +33,8 @@ impl TryFrom<User> for UserProfileResponse {
id: user.id.map(|id| id.to_string()).unwrap_or_default(),
email: user.email,
username: user.username,
created_at: user.created_at.to_rfc3339(),
last_active: user.last_active.to_rfc3339(),
created_at: user.created_at.timestamp_millis(),
last_active: user.last_active.timestamp_millis(),
email_verified: user.email_verified,
})
}