AbubakarLawalAlawAbula I don't think the matter at hand has anything to do with Mithril ?
You're extending a method with Flarum extend
helper. Then the params
are just a plain javascript object that will be used to build the request.
I don't know if you already implemented the backend code that will handle that new request parameter ?
You could use something like params.filter.frontpage = 'true'
if you wanted to use /api/discussions?filter[frontpage]=true
.
If you want to pass a special keyword as part of the q
parameter this will be a bit more complicated, both to inject and read if you don't want to break the base search feature.
The goal is to only return the "frontpage" discussions on whichever page you're overriding requestParam
? Keep in mind that if you don't add a condition within your extend code, all discussions lists will get that parameter (front page, tag discussions, user discussions, ...). For example you can access app.current
to know which page you're on inside the extended method.