use `Leaderboard#increment` when creating leaderboard score

This commit is contained in:
Christopher Van 2014-08-28 16:34:10 -07:00
Родитель 3bf5e6fb3e
Коммит 93bd31fa3d
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -223,11 +223,13 @@ exports.scores_create = function *() {
var gameSlug = this.params.game_slug;
var boardSlug = this.params.board_slug;
yield new Leaderboard({
var leaderboard = new Leaderboard({
game: gameSlug,
slug: boardSlug,
payload: payload
}).add(payload.user, payload.score).then(function () {
});
yield leaderboard.incr(payload.user, payload.score).then(function () {
response.success();
}).catch(response.dbError);
};