mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
5aab41931f
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
21 lines
689 B
JavaScript
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)
|
|
};
|