🐛 Fixed broken activity feed and click filter

fixes https://github.com/TryGhost/Ghost/issues/15515

- The link relation of a member-click-event was still using the link_id as foreign key instead of redirect_id.
- The members_link_click_events table was renamed to members_click_events, but this change was not reflected in a recent change in the member model (which has the custom filters).
This commit is contained in:
Simon Backx 2022-10-03 09:52:24 +02:00
parent a7556ad9ea
commit b80c2cd81b
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ const MemberClickEvent = ghostBookshelf.Model.extend({
tableName: 'members_click_events',
link() {
return this.belongsTo('Redirect', 'link_id');
return this.belongsTo('Redirect', 'redirect_id');
},
member() {

View File

@ -100,12 +100,12 @@ const Member = ghostBookshelf.Model.extend({
joinFrom: 'member_id'
},
clicked_links: {
tableName: 'link_redirects',
tableName: 'redirects',
tableNameAs: 'clicked_links',
type: 'manyToMany',
joinTable: 'members_link_click_events',
joinTable: 'members_click_events',
joinFrom: 'member_id',
joinTo: 'link_id'
joinTo: 'redirect_id'
},
emails: {
tableName: 'emails',