use nexus_common::models::post::PostRelationships;
use nexus_common::types::DynError;
pub async fn post_relationships_is_reply(author_id: &str, post_id: &str) -> Result<bool, DynError> {
match PostRelationships::get_by_id(author_id, post_id).await? {
Some(relationship) => Ok(relationship.replied.is_some()),
None => Ok(true),
}
}
#[macro_export]
macro_rules! handle_indexing_results {
($($res:expr),+) => {
{ let results = [$($res),+];
for result in results {
result.map_err(|e| EventProcessorError::IndexWriteFailed {
message: e.to_string(),
})?;
}
}
};
}