mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
18b8eddd0d
refs: https://github.com/TryGhost/Toolbox/issues/147 Errors in @tryghost/errors rely on being called with an object (with a `message` member) rather than with a string.
28 lines
869 B
JavaScript
28 lines
869 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({message: 'Cannot edit MemberEmailChangeEvent'});
|
|
},
|
|
|
|
async destroy() {
|
|
throw new errors.IncorrectUsageError({message: 'Cannot destroy MemberEmailChangeEvent'});
|
|
}
|
|
});
|
|
|
|
const MemberEmailChangeEvents = ghostBookshelf.Collection.extend({
|
|
model: MemberEmailChangeEvent
|
|
});
|
|
|
|
module.exports = {
|
|
MemberEmailChangeEvent: ghostBookshelf.model('MemberEmailChangeEvent', MemberEmailChangeEvent),
|
|
MemberEmailChangeEvents: ghostBookshelf.collection('MemberEmailChangeEvents', MemberEmailChangeEvents)
|
|
};
|