vote method
Implementation
Future<dynamic> vote(dynamic postOrComment, String choice) async {
// String route;
// if ("${postOrComment.parentIdx}".toInt > 0) {
// route = 'comment.vote';
// } else {
// route = 'post.vote';
// }
final re = await request({'route': 'post.vote', 'idx': postOrComment.idx, 'choice': choice});
if ("${postOrComment.parentIdx}".toInt > 0) {
return ApiComment.fromJson(re);
} else {
return ApiPost.fromJson(re);
}
}