mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 09:22:49 +03:00
27b9e4ae04
refs https://github.com/TryGhost/Ghost/issues/12602 When listing site-wide event, we want to include member information so that we can contextualise the event when displaying it.
28 lines
847 B
JavaScript
28 lines
847 B
JavaScript
const errors = require('@tryghost/errors');
|
|
const ghostBookshelf = require('./base');
|
|
|
|
const MemberEmailChangeEvent = ghostBookshelf.Model.extend({
|
|
tableName: 'members_email_change_events',
|
|
|
|
member() {
|
|
return this.belongsTo('Member', 'member_id', 'id');
|
|
}
|
|
}, {
|
|
async edit() {
|
|
throw new errors.IncorrectUsageError('Cannot edit MemberEmailChangeEvent');
|
|
},
|
|
|
|
async destroy() {
|
|
throw new errors.IncorrectUsageError('Cannot destroy MemberEmailChangeEvent');
|
|
}
|
|
});
|
|
|
|
const MemberEmailChangeEvents = ghostBookshelf.Collection.extend({
|
|
model: MemberEmailChangeEvent
|
|
});
|
|
|
|
module.exports = {
|
|
MemberEmailChangeEvent: ghostBookshelf.model('MemberEmailChangeEvent', MemberEmailChangeEvent),
|
|
MemberEmailChangeEvents: ghostBookshelf.collection('MemberEmailChangeEvents', MemberEmailChangeEvents)
|
|
};
|