Finished guestbook and gallery. started diary
This commit is contained in:
@@ -17,6 +17,7 @@ import ImageVisibilityUser from './community/image_visibility_user.js';
|
||||
import FolderImageVisibility from './community/folder_image_visibility.js';
|
||||
import ImageImageVisibility from './community/image_image_visibility.js';
|
||||
import FolderVisibilityUser from './community/folder_visibility_user.js';
|
||||
import GuestbookEntry from './community/guestbook.js';
|
||||
|
||||
export default function setupAssociations() {
|
||||
SettingsType.hasMany(UserParamType, { foreignKey: 'settingsId', as: 'user_param_types' });
|
||||
@@ -95,4 +96,25 @@ export default function setupAssociations() {
|
||||
foreignKey: 'visibilityUserId',
|
||||
otherKey: 'folderId'
|
||||
});
|
||||
|
||||
User.hasMany(GuestbookEntry, {
|
||||
foreignKey: 'recipientId',
|
||||
as: 'receivedEntries'
|
||||
});
|
||||
|
||||
User.hasMany(GuestbookEntry, {
|
||||
foreignKey: 'senderId',
|
||||
as: 'sentEntries'
|
||||
});
|
||||
|
||||
GuestbookEntry.belongsTo(User, {
|
||||
foreignKey: 'recipientId',
|
||||
as: 'recipient'
|
||||
});
|
||||
|
||||
GuestbookEntry.belongsTo(User, {
|
||||
foreignKey: 'senderId',
|
||||
as: 'sender'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user