addVote method
Future<TranslationVote>
addVote(
- Translation translation,
- TranslationVoteType type, {
- 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);
}