mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can create new choices for a survey
This commit is contained in:
@ -127,6 +127,14 @@ pub fn send_response(user_id: &UserID, survey_id: u64, choice_id: u64) -> Result
|
||||
.insert_drop_result()
|
||||
}
|
||||
|
||||
/// Block new survey choices from being created
|
||||
pub fn block_new_choices_creation(survey_id: u64) -> ResultBoxError {
|
||||
database::UpdateInfo::new(SURVEY_INFO_TABLE)
|
||||
.cond_u64("ID", survey_id)
|
||||
.set_legacy_bool("allow_new_choices", false)
|
||||
.exec()
|
||||
}
|
||||
|
||||
/// Turn a database entry into a row object
|
||||
fn db_to_survey(row: &database::RowResult) -> ResultBoxError<Survey> {
|
||||
let survey_id = row.get_u64("ID")?;
|
||||
|
Reference in New Issue
Block a user