Bugs in settings fixed, profile added
This commit is contained in:
@@ -61,22 +61,4 @@ 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: val }
|
||||
});
|
||||
|
||||
if (!created) {
|
||||
userParam.value = value !== null && value !== undefined ? value.toString() : '';
|
||||
await userParam.save();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error in upsertParam:', error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
export default UserParam;
|
||||
|
||||
Reference in New Issue
Block a user