1
0
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:
2020-05-18 18:43:57 +02:00
parent 5086f45cc1
commit e0d69ab504
2 changed files with 52 additions and 3 deletions

View File

@ -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)