From addb8e9a6dbb4113950257fb8ae7f72273b3ee05 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 18 Dec 2025 15:43:54 +0100 Subject: [PATCH] Refactor Notification model to remove VIRTUAL field definition for characterName and implement a getter method for improved data handling and synchronization. --- backend/models/falukant/log/notification.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/models/falukant/log/notification.js b/backend/models/falukant/log/notification.js index 71f0c05..57bd59e 100644 --- a/backend/models/falukant/log/notification.js +++ b/backend/models/falukant/log/notification.js @@ -1,7 +1,12 @@ import { Model, DataTypes } from 'sequelize'; import { sequelize } from '../../../utils/sequelize.js'; -class Notification extends Model { } +class Notification extends Model { + // Getter für characterName - wird nicht synchronisiert, da es kein Datenbankfeld ist + get characterName() { + return this.getDataValue('character_name') || null; + } +} Notification.init({ userId: { @@ -15,12 +20,6 @@ Notification.init({ allowNull: true, field: 'character_name' }, - characterName: { - type: DataTypes.VIRTUAL, - get() { - return this.getDataValue('character_name') || null; - } - }, shown: { type: DataTypes.BOOLEAN, allowNull: false,