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
|
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue