Skip to content

Commit

Permalink
Fix serialization format for optional datetimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Oct 8, 2024
1 parent cc0a6ae commit dee32c6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deepwell/src/services/file/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ pub struct GetFileOutput {

#[serde(with = "time::serde::rfc3339")]
pub file_created_at: OffsetDateTime,

#[serde(with = "time::serde::rfc3339::option")]
pub file_updated_at: Option<OffsetDateTime>,

#[serde(with = "time::serde::rfc3339::option")]
pub file_deleted_at: Option<OffsetDateTime>,
pub page_id: i64,
pub revision_id: i64,
Expand Down
2 changes: 2 additions & 0 deletions deepwell/src/services/link/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ pub struct GetLinksExternalToOutput {
pub struct ToExternalLink {
#[serde(with = "time::serde::rfc3339")]
pub created_at: OffsetDateTime,

#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<OffsetDateTime>,
pub page_id: i64,
pub count: i32,
Expand Down
4 changes: 4 additions & 0 deletions deepwell/src/services/page/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ pub struct GetPageOutput {

#[serde(with = "time::serde::rfc3339")]
pub page_created_at: OffsetDateTime,

#[serde(with = "time::serde::rfc3339::option")]
pub page_updated_at: Option<OffsetDateTime>,

#[serde(with = "time::serde::rfc3339::option")]
pub page_deleted_at: Option<OffsetDateTime>,
pub page_revision_count: i32,
pub site_id: i64,
Expand Down
2 changes: 2 additions & 0 deletions deepwell/src/services/page_revision/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ pub struct PageRevisionModelFiltered {

#[serde(with = "time::serde::rfc3339")]
pub created_at: OffsetDateTime,

#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<OffsetDateTime>,
pub from_wikidot: bool,
pub revision_number: i32,
Expand Down

0 comments on commit dee32c6

Please sign in to comment.