fix: indexpage search not hitting custom endpoint

This commit is contained in:
David Wheatley 2021-10-31 22:47:46 +00:00
parent ef4b02b562
commit c96a0f54bf
No known key found for this signature in database
GPG Key ID: DCC0FCE349280DFF
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,9 @@ import DiscussionListState from 'flarum/forum/states/DiscussionListState';
export default function extendDiscussionState() { export default function extendDiscussionState() {
override(DiscussionListState.prototype, 'loadPage', async function (this: DiscussionListState, original, page: number = 1) { override(DiscussionListState.prototype, 'loadPage', async function (this: DiscussionListState, original, page: number = 1) {
if (!this.requestParams().q?.length) return original.call(this, page); console.log(this.requestParams());
if (!this.requestParams()?.filter?.q) return original.call(this, page);
const params = this.requestParams(); const params = this.requestParams();
params.page = { params.page = {