@replyke/express
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
10 lines (9 loc) • 456 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = updateUserReputation;
const models_1 = require("../models");
const config_1 = require("../config");
async function updateUserReputation(userId, change, transaction) {
const { sequelize } = (0, config_1.getCoreConfig)();
await models_1.User.update({ reputation: sequelize.literal(`"reputation" + ${change}`) }, { where: { id: userId }, transaction });
}