En-/decryption fixed
This commit is contained in:
@@ -63,13 +63,14 @@ const UserParam = sequelize.define('user_param', {
|
||||
|
||||
UserParam.upsertParam = async function (userId, paramTypeId, value) {
|
||||
try {
|
||||
const val = value !== null && value !== undefined ? value.toString() : '';
|
||||
const [userParam, created] = await UserParam.findOrCreate({
|
||||
where: { userId, paramTypeId },
|
||||
defaults: { value }
|
||||
defaults: { value: val }
|
||||
});
|
||||
|
||||
if (!created) {
|
||||
userParam.value = value;
|
||||
userParam.value = value !== null && value !== undefined ? value.toString() : '';
|
||||
await userParam.save();
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user