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:
parent
8e7d11ce40
commit
a68d037cef
3 changed files with 25 additions and 0 deletions
|
@ -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',
|
||||
|
|
23
core/server/models/member-email-change-event.js
Normal file
23
core/server/models/member-email-change-event.js
Normal 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)
|
||||
};
|
|
@ -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
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue