mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
4ce9a5a167
refs https://github.com/TryGhost/Team/issues/1302 - This event stores the members' subscription cancelations.
29 lines
809 B
JavaScript
29 lines
809 B
JavaScript
const errors = require('@tryghost/errors');
|
|
const ghostBookshelf = require('./base');
|
|
|
|
const MemberCancelEvent = ghostBookshelf.Model.extend({
|
|
tableName: 'members_cancel_events',
|
|
|
|
member() {
|
|
return this.belongsTo('Member', 'member_id', 'id');
|
|
}
|
|
}, {
|
|
async edit() {
|
|
throw new errors.IncorrectUsageError({message: 'Cannot edit MemberCancelEvent'});
|
|
},
|
|
|
|
async destroy() {
|
|
throw new errors.IncorrectUsageError({message: 'Cannot destroy MemberCancelEvent'});
|
|
}
|
|
});
|
|
|
|
const MemberCancelEvents = ghostBookshelf.Collection.extend({
|
|
model: MemberCancelEvent
|
|
});
|
|
|
|
module.exports = {
|
|
MemberCancelEvent: ghostBookshelf.model('MemberCancelEvent', MemberCancelEvent),
|
|
MemberCancelEvents: ghostBookshelf.collection('MemberCancelEvents', MemberCancelEvents)
|
|
};
|
|
|