diff --git a/js/src/forum/models/Poll.ts b/js/src/forum/models/Poll.ts index d1db3923..b209d386 100755 --- a/js/src/forum/models/Poll.ts +++ b/js/src/forum/models/Poll.ts @@ -60,15 +60,15 @@ export default class Poll extends Model { } options() { - return Model.hasMany('options'); + return Model.hasMany('options').call(this); } votes() { - return Model.hasMany('votes'); + return Model.hasMany('votes').call(this); } myVotes() { - return Model.hasMany('myVotes'); + return Model.hasMany('myVotes').call(this); } apiEndpoint() { diff --git a/js/src/forum/models/PollOption.ts b/js/src/forum/models/PollOption.ts index 172fb899..e427a33d 100755 --- a/js/src/forum/models/PollOption.ts +++ b/js/src/forum/models/PollOption.ts @@ -11,7 +11,7 @@ export default class PollOption extends Model { return Model.attribute('imageUrl').call(this); } - vouteCount() { + voteCount() { return Model.attribute('voteCount').call(this); } diff --git a/js/src/forum/models/PollVote.ts b/js/src/forum/models/PollVote.ts index 98c26f71..1eaa1ee1 100755 --- a/js/src/forum/models/PollVote.ts +++ b/js/src/forum/models/PollVote.ts @@ -5,23 +5,23 @@ import User from 'flarum/common/models/User'; export default class PollVote extends Model { poll() { - return Model.hasOne('poll'); + return Model.hasOne('poll').call(this); } option() { - return Model.hasOne('option'); + return Model.hasOne('option').call(this); } user() { - return Model.hasOne('user'); + return Model.hasOne('user').call(this); } pollId() { - return Model.attribute('pollId'); + return Model.attribute('pollId').call(this); } optionId() { - return Model.attribute('optionId'); + return Model.attribute('optionId').call(this); } apiEndpoint() {