addVote method

Future<TranslationVote> addVote(
  1. Translation translation,
  2. TranslationVoteType type, {
  3. String? token,
})

Add a vote to a translation. Parameters

  • translationUUID The UUID of the translation to vote on.
  • type Up or down vote.
  • token The token to use for authentication (optional if you have set a global token).

Implementation

Future<TranslationVote> addVote(
    Translation translation, TranslationVoteType type,
    {String? token}) async {
  APIHttpResponse response = await httpClient.post('/translate/vote/',
      body: {
        'translationUUID': translation.uuid,
        'type': type.name,
      },
      token: token);

  return TranslationVote.fromMap(response.data);
}