diff --git a/js/src/forum/states/PollListState.ts b/js/src/forum/states/PollListState.ts index 2a9cc8a8..0849abf6 100644 --- a/js/src/forum/states/PollListState.ts +++ b/js/src/forum/states/PollListState.ts @@ -26,7 +26,7 @@ export default class PollListState
ex requestParams(): PaginatedListRequestParams { const params = { - include: this.params.include || ['options', 'votes'], + include: this.requestIncludes(), filter: this.params.filter || {}, sort: this.sortMap()[this.params.sort ?? ''], }; @@ -38,6 +38,20 @@ export default class PollListState
ex
return params;
}
+ includes(): string[] {
+ return ['options', 'votes'];
+ }
+
+ private requestIncludes(): string {
+ const standard = this.includes();
+
+ // merge the standard includes with the custom includes
+ const merged = [...standard, ...(this.params.include || [])];
+
+ // return as a comma separated string
+ return merged.join(',');
+ }
+
protected loadPage(page: number = 1): Promise