I'm building a small forum app with Laravel and Vue and currently i'm adding filter buttons to fetch threads based on the filter button.
For example, in a Vue component, i have the following button, which essentially makes a get request to the back-end and fetches the threads created by the authenticated user
<a href="/threads?myThreads=1"> My Threads </a>
But in addition to the button above i have other filters as well
- Threads i have replied to
- Threads that were created 7 days ago
However, i want to hide the clicked buttons based on the query strings
window.location.href
For example if i click the button My Threads, then the href will be
/threads?=myThreads=1
In this case i want to hide the button My Threads, based on the href.
My question
Is this a bad approach ? To make decisions based on the href.
Should i try a different approach ? Such as, passing data from the backend to to front end