Added movability of dialogs

This commit is contained in:
Torsten Schulz
2024-08-19 12:34:08 +02:00
parent 4b6ad3aefe
commit 16a59daf39
40 changed files with 1625 additions and 204 deletions

View File

@@ -5,6 +5,9 @@ import UserRightType from './type/user_right.js';
import UserRight from './community/user_right.js';
import SettingsType from './type/settings.js';
import UserParamValue from './type/user_param_value.js';
import InterestType from './type/interest.js';
import InterestTranslationType from './type/interest_translation.js';
import Interest from './community/interest.js';
export default function setupAssociations() {
SettingsType.hasMany(UserParamType, { foreignKey: 'settingsId', as: 'user_param_types' });
@@ -18,7 +21,23 @@ export default function setupAssociations() {
UserRight.belongsTo(User, { foreignKey: 'userId' });
UserRight.belongsTo(UserRightType, { foreignKey: 'rightTypeId', as: 'rightType' });
UserRightType.hasMany(UserRight, { foreignKey: 'rightTypeId', as: 'rightType' });
UserParamType.hasMany(UserParamValue, { foreignKey: 'userParamTypeId', as: 'user_param_values' });
UserParamValue.belongsTo(UserParamType, { foreignKey: 'userParamTypeId', as: 'user_param_type' });
InterestType.hasMany(InterestTranslationType, { foreignKey: 'interestsId', as: 'interest_translations' });
InterestTranslationType.belongsTo(InterestType, { foreignKey: 'interestsId', as: 'interest_translations' });
InterestType.hasMany(Interest, { foreignKey: 'userinterestId', as: 'user_interest_type'} );
User.hasMany(Interest, { foreignKey: 'userId', as: 'user_interest' });
Interest.belongsTo(InterestType, { foreignKey: 'userinterestId', as: 'user_interest_type' });
Interest.belongsTo(User, { foreignKey: 'userId', as: 'user_interest' });
InterestTranslationType.belongsTo(UserParamValue, {
foreignKey: 'language',
targetKey: 'id',
as: 'user_param_value'
});
}