Ghost/core/server/models/member-subscribe-event.js
Fabien O'Carroll 5aab41931f 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
2021-02-05 16:02:08 +00:00

21 lines
689 B
JavaScript

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)
};