0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00

Added skeleton MemberSubscribeEvent model

refs https://github.com/TryGhost/Ghost/issues/12602

Member Events in general are read-only after they've been created, so
we've explicitly disallowed destroying and editing via the model
This commit is contained in:
Fabien O'Carroll 2021-02-04 09:22:40 +00:00 committed by Fabien 'egg' O'Carroll
parent 065bbaeafa
commit 5aab41931f
2 changed files with 21 additions and 0 deletions

View file

@ -28,6 +28,7 @@ const models = [
'api-key',
'mobiledoc-revision',
'member',
'member-subscribe-event',
'posts-meta',
'member-stripe-customer',
'stripe-customer-subscription',

View file

@ -0,0 +1,20 @@
const ghostBookshelf = require('./base');
const MemberSubscribeEvent = ghostBookshelf.Model.extend({tableName: 'members_subscribe_events'}, {
async edit() {
throw new errors.IncorrectUsageError('Cannot edit MemberSubscribeEvent');
},
async destroy() {
throw new errors.IncorrectUsageError('Cannot destroy MemberSubscribeEvent');
}
});
const MemberSubscribeEvents = ghostBookshelf.Collection.extend({
model: MemberSubscribeEvent
});
module.exports = {
MemberSubscribeEvent: ghostBookshelf.model('MemberSubscribeEvent', MemberSubscribeEvent),
MemberSubscribeEvents: ghostBookshelf.collection('MemberSubscribeEvents', MemberSubscribeEvents)
};