mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can block the creation of new responses on a survey
This commit is contained in:
@ -34,6 +34,12 @@ class SurveyHelper {
|
||||
.isOK;
|
||||
}
|
||||
|
||||
/// Prevent new choices from being created on a survey
|
||||
static Future<void> blockNewChoicesCreation(int postID) async =>
|
||||
await APIRequest.withLogin("surveys/block_new_choices_creation")
|
||||
.addInt("postID", postID)
|
||||
.execWithThrow();
|
||||
|
||||
/// Turn an API entry into a [Survey] object
|
||||
static Survey apiToSurvey(Map<String, dynamic> map) {
|
||||
// Parse survey responses
|
||||
@ -50,6 +56,7 @@ class SurveyHelper {
|
||||
question: map["question"],
|
||||
userChoice: map["user_choice"],
|
||||
choices: choices,
|
||||
allowNewChoicesCreation: map["allowNewChoices"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user