0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Added MemberEmailChangeEvent model

refs https://github.com/TryGhost/Ghost/issues/12602
This commit is contained in:
Fabien O'Carroll 2021-02-12 13:15:27 +00:00 committed by Fabien 'egg' O'Carroll
parent 8e7d11ce40
commit a68d037cef
3 changed files with 25 additions and 0 deletions

View file

@ -30,6 +30,7 @@ const models = [
'member',
'member-subscribe-event',
'member-login-event',
'member-email-change-event',
'member-payment-event',
'member-status-event',
'posts-meta',

View file

@ -0,0 +1,23 @@
const errors = require('@tryghost/errors');
const ghostBookshelf = require('./base');
const MemberEmailChangeEvent = ghostBookshelf.Model.extend({
tableName: 'members_email_change_events'
}, {
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)
};

View file

@ -171,6 +171,7 @@ function createApiInstance(config) {
Member: models.Member,
MemberSubscribeEvent: models.MemberSubscribeEvent,
MemberLoginEvent: models.MemberLoginEvent,
MemberEmailChangeEvent: models.MemberEmailChangeEvent,
MemberPaymentEvent: models.MemberPaymentEvent,
MemberStatusEvent: models.MemberStatusEvent
},