add: product uploads

This commit is contained in:
trisua 2025-07-13 23:15:00 -04:00
parent 292d302304
commit 3b5b0ce1a1
8 changed files with 27 additions and 7 deletions

View file

@ -45,7 +45,11 @@ impl DataManager {
question: &Question,
) -> Result<Option<(User, Post)>> {
Ok(if let Some(id) = question.context.asking_about {
let post = self.get_post_by_id(id).await?;
let post = match self.get_post_by_id(id).await {
Ok(x) => x,
Err(_) => return Ok(None),
};
Some((self.get_user_by_id(post.owner).await?, post))
} else {
None