mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can create a new choice for the survey
This commit is contained in:
@ -34,7 +34,18 @@ class SurveyHelper {
|
||||
.isOK;
|
||||
}
|
||||
|
||||
/// Create a new choice in a survey
|
||||
///
|
||||
/// Throws in case of failure
|
||||
static Future<void> createNewChoice(int postID, String newChoice) async =>
|
||||
await APIRequest.withLogin("surveys/create_new_choice")
|
||||
.addInt("postID", postID)
|
||||
.addString("choice", newChoice)
|
||||
.execWithThrow();
|
||||
|
||||
/// Prevent new choices from being created on a survey
|
||||
///
|
||||
/// Throws in case of failure
|
||||
static Future<void> blockNewChoicesCreation(int postID) async =>
|
||||
await APIRequest.withLogin("surveys/block_new_choices_creation")
|
||||
.addInt("postID", postID)
|
||||
|
Reference in New Issue
Block a user