diff options
Diffstat (limited to 'server/models/video/video-abuse.ts')
-rw-r--r-- | server/models/video/video-abuse.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/models/video/video-abuse.ts b/server/models/video/video-abuse.ts index ebc63e7a0..c1d070ec0 100644 --- a/server/models/video/video-abuse.ts +++ b/server/models/video/video-abuse.ts | |||
@@ -45,7 +45,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da | |||
45 | fields: [ 'videoId' ] | 45 | fields: [ 'videoId' ] |
46 | }, | 46 | }, |
47 | { | 47 | { |
48 | fields: [ 'reporterPodId' ] | 48 | fields: [ 'reporterServerId' ] |
49 | } | 49 | } |
50 | ] | 50 | ] |
51 | } | 51 | } |
@@ -67,18 +67,18 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da | |||
67 | // ------------------------------ METHODS ------------------------------ | 67 | // ------------------------------ METHODS ------------------------------ |
68 | 68 | ||
69 | toFormattedJSON = function (this: VideoAbuseInstance) { | 69 | toFormattedJSON = function (this: VideoAbuseInstance) { |
70 | let reporterPodHost | 70 | let reporterServerHost |
71 | 71 | ||
72 | if (this.Pod) { | 72 | if (this.Server) { |
73 | reporterPodHost = this.Pod.host | 73 | reporterServerHost = this.Server.host |
74 | } else { | 74 | } else { |
75 | // It means it's our video | 75 | // It means it's our video |
76 | reporterPodHost = CONFIG.WEBSERVER.HOST | 76 | reporterServerHost = CONFIG.WEBSERVER.HOST |
77 | } | 77 | } |
78 | 78 | ||
79 | const json = { | 79 | const json = { |
80 | id: this.id, | 80 | id: this.id, |
81 | reporterPodHost, | 81 | reporterServerHost, |
82 | reason: this.reason, | 82 | reason: this.reason, |
83 | reporterUsername: this.reporterUsername, | 83 | reporterUsername: this.reporterUsername, |
84 | videoId: this.videoId, | 84 | videoId: this.videoId, |
@@ -91,9 +91,9 @@ toFormattedJSON = function (this: VideoAbuseInstance) { | |||
91 | // ------------------------------ STATICS ------------------------------ | 91 | // ------------------------------ STATICS ------------------------------ |
92 | 92 | ||
93 | function associate (models) { | 93 | function associate (models) { |
94 | VideoAbuse.belongsTo(models.Pod, { | 94 | VideoAbuse.belongsTo(models.Server, { |
95 | foreignKey: { | 95 | foreignKey: { |
96 | name: 'reporterPodId', | 96 | name: 'reporterServerId', |
97 | allowNull: true | 97 | allowNull: true |
98 | }, | 98 | }, |
99 | onDelete: 'CASCADE' | 99 | onDelete: 'CASCADE' |
@@ -115,7 +115,7 @@ listForApi = function (start: number, count: number, sort: string) { | |||
115 | order: [ getSort(sort) ], | 115 | order: [ getSort(sort) ], |
116 | include: [ | 116 | include: [ |
117 | { | 117 | { |
118 | model: VideoAbuse['sequelize'].models.Pod, | 118 | model: VideoAbuse['sequelize'].models.Server, |
119 | required: false | 119 | required: false |
120 | } | 120 | } |
121 | ] | 121 | ] |