En-/decryption fixed

This commit is contained in:
Torsten Schulz
2024-07-28 16:12:48 +02:00
parent 4c12303edc
commit 4b6ad3aefe
27 changed files with 3315 additions and 97 deletions

View File

@@ -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) {