add: "ask about this" from neospring
This commit is contained in:
parent
f94570f74c
commit
2c83ed3d9d
9 changed files with 122 additions and 31 deletions
|
@ -96,6 +96,13 @@ pub async fn create_request(
|
|||
props.context.mask_owner = true;
|
||||
}
|
||||
|
||||
if !req.asking_about.is_empty() && !req.is_global {
|
||||
props.context.asking_about = match req.asking_about.parse::<usize>() {
|
||||
Ok(x) => Some(x),
|
||||
Err(e) => return Json(Error::MiscError(e.to_string()).into()),
|
||||
}
|
||||
}
|
||||
|
||||
match data
|
||||
.create_question(props, drawings.iter().map(|x| x.to_vec()).collect())
|
||||
.await
|
||||
|
|
|
@ -865,6 +865,8 @@ pub struct CreateQuestion {
|
|||
pub community: String,
|
||||
#[serde(default)]
|
||||
pub mask_owner: bool,
|
||||
#[serde(default)]
|
||||
pub asking_about: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue