Skip to content

Commit

Permalink
Merge pull request #1181 from AppFlowy-IO/update-publish-info
Browse files Browse the repository at this point in the history
feat: add comments enabled and duplicate enabled to publish info
  • Loading branch information
khorshuheng authored Jan 20, 2025
2 parents 10a4b3a + 44dee16 commit 524bdef
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions libs/database-entity/src/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,18 @@ pub struct PublishInfo {
pub publish_timestamp: DateTime<Utc>,
#[serde(default)]
pub unpublished_timestamp: Option<DateTime<Utc>>,
#[serde(default = "default_comments_enabled")]
pub comments_enabled: bool,
#[serde(default = "default_duplicate_enabled")]
pub duplicate_enabled: bool,
}

fn default_comments_enabled() -> bool {
true
}

fn default_duplicate_enabled() -> bool {
true
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
8 changes: 6 additions & 2 deletions libs/database/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@ pub async fn select_publish_info_for_view_ids(
apc.view_id,
au.email AS publisher_email,
apc.created_at AS publish_timestamp,
apc.unpublished_at AS unpublished_timestamp
apc.unpublished_at AS unpublished_timestamp,
apc.comments_enabled,
apc.duplicate_enabled
FROM af_published_collab apc
JOIN af_user au ON apc.published_by = au.uid
JOIN af_workspace aw ON apc.workspace_id = aw.workspace_id
Expand Down Expand Up @@ -630,7 +632,9 @@ pub async fn select_all_published_collab_info(
apc.view_id,
au.email AS publisher_email,
apc.created_at AS publish_timestamp,
apc.unpublished_at AS unpublished_timestamp
apc.unpublished_at AS unpublished_timestamp,
apc.comments_enabled,
apc.duplicate_enabled
FROM af_published_collab apc
JOIN af_user au ON apc.published_by = au.uid
JOIN af_workspace aw ON apc.workspace_id = aw.workspace_id
Expand Down

0 comments on commit 524bdef

Please sign in to comment.