Return result of query as variable

Put the return SumAllVotes inside the then block.

[output: Parsing error: unexpected token return]