MCPcopy Create free account
hub / github.com/acking-you/static_flow / patch_published_comment

Method patch_published_comment

crates/store/src/comments_store.rs:583–608  ·  view source on GitHub ↗
(
        &self,
        comment_id: &str,
        patch: PublishedCommentPatch,
    )

Source from the content-addressed store, hash-verified

581 }
582
583 pub async fn patch_published_comment(
584 &self,
585 comment_id: &str,
586 patch: PublishedCommentPatch,
587 ) -> Result<Option<PublishedCommentRecord>> {
588 let mut record = match self.get_published_comment_by_comment_id(comment_id).await? {
589 Some(record) => record,
590 None => return Ok(None),
591 };
592
593 if let Some(value) = patch.comment_text {
594 let trimmed = value.trim();
595 if !trimmed.is_empty() {
596 record.comment_text = trimmed.to_string();
597 }
598 }
599
600 if let Some(value) = patch.ai_reply_markdown {
601 record.ai_reply_markdown = value.trim().to_string();
602 }
603
604 record.published_at = now_ms();
605 let table = self.published_table().await?;
606 upsert_published_comment_record(&table, &record).await?;
607 Ok(Some(record))
608 }
609
610 pub async fn delete_published_comment(&self, comment_id: &str) -> Result<()> {
611 let table = self.published_table().await?;

Callers 1

Calls 6

trimMethod · 0.80
published_tableMethod · 0.80
now_msFunction · 0.70
is_emptyMethod · 0.45

Tested by

no test coverage detected