mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added member relation to events (#12656)
refs https://github.com/TryGhost/Ghost/issues/12602 When listing site-wide event, we want to include member information so that we can contextualise the event when displaying it.
This commit is contained in:
parent
33bd36b4d6
commit
27b9e4ae04
6 changed files with 30 additions and 2 deletions
|
@ -2,7 +2,11 @@ const errors = require('@tryghost/errors');
|
|||
const ghostBookshelf = require('./base');
|
||||
|
||||
const MemberEmailChangeEvent = ghostBookshelf.Model.extend({
|
||||
tableName: 'members_email_change_events'
|
||||
tableName: 'members_email_change_events',
|
||||
|
||||
member() {
|
||||
return this.belongsTo('Member', 'member_id', 'id');
|
||||
}
|
||||
}, {
|
||||
async edit() {
|
||||
throw new errors.IncorrectUsageError('Cannot edit MemberEmailChangeEvent');
|
||||
|
|
|
@ -2,7 +2,11 @@ const errors = require('@tryghost/errors');
|
|||
const ghostBookshelf = require('./base');
|
||||
|
||||
const MemberLoginEvent = ghostBookshelf.Model.extend({
|
||||
tableName: 'members_login_events'
|
||||
tableName: 'members_login_events',
|
||||
|
||||
member() {
|
||||
return this.belongsTo('Member', 'member_id', 'id');
|
||||
}
|
||||
}, {
|
||||
async edit() {
|
||||
throw new errors.IncorrectUsageError('Cannot edit MemberLoginEvent');
|
||||
|
|
|
@ -3,6 +3,11 @@ const ghostBookshelf = require('./base');
|
|||
|
||||
const MemberPaidSubscriptionEvent = ghostBookshelf.Model.extend({
|
||||
tableName: 'members_paid_subscription_events',
|
||||
|
||||
member() {
|
||||
return this.belongsTo('Member', 'member_id', 'id');
|
||||
},
|
||||
|
||||
customQuery(qb, options) {
|
||||
if (options.aggregateMRRDeltas) {
|
||||
if (options.limit || options.filter) {
|
||||
|
|
|
@ -3,6 +3,11 @@ const ghostBookshelf = require('./base');
|
|||
|
||||
const MemberPaymentEvent = ghostBookshelf.Model.extend({
|
||||
tableName: 'members_payment_events',
|
||||
|
||||
member() {
|
||||
return this.belongsTo('Member', 'member_id', 'id');
|
||||
},
|
||||
|
||||
customQuery(qb, options) {
|
||||
if (options.aggregatePaymentVolume) {
|
||||
if (options.limit || options.filter) {
|
||||
|
|
|
@ -3,6 +3,11 @@ const ghostBookshelf = require('./base');
|
|||
|
||||
const MemberStatusEvent = ghostBookshelf.Model.extend({
|
||||
tableName: 'members_status_events',
|
||||
|
||||
member() {
|
||||
return this.belongsTo('Member', 'member_id', 'id');
|
||||
},
|
||||
|
||||
customQuery(qb, options) {
|
||||
if (options.aggregateStatusCounts) {
|
||||
if (options.limit || options.filter) {
|
||||
|
|
|
@ -3,6 +3,11 @@ const ghostBookshelf = require('./base');
|
|||
|
||||
const MemberSubscribeEvent = ghostBookshelf.Model.extend({
|
||||
tableName: 'members_subscribe_events',
|
||||
|
||||
member() {
|
||||
return this.belongsTo('Member', 'member_id', 'id');
|
||||
},
|
||||
|
||||
customQuery(qb, options) {
|
||||
if (options.aggregateSubscriptionDeltas) {
|
||||
if (options.limit || options.filter) {
|
||||
|
|
Loading…
Reference in a new issue