-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!DNMY - WIP! Wiring up the front end to use call the opportunities API with search #64
base: master
Are you sure you want to change the base?
!DNMY - WIP! Wiring up the front end to use call the opportunities API with search #64
Conversation
alifhughes
commented
Apr 21, 2021
•
edited
Loading
edited
- Still WIP
- I didn't have enough time to finish this but I hope it serves as a jumping off point for someone who will implement this page
- Gif included demonstrates how it works
- Not sure if this is the best/right way to implement this, I think not - but hopefully it will be useful in someway
@@ -10,7 +10,7 @@ | |||
</q-card-section> | |||
<!-- search bar --> | |||
<q-toolbar> | |||
<q-input rounded outlined class="search-bar" v-model="filter" type="text" > | |||
<q-input rounded outlined class="search-bar" v-on:input="filterOpportunities" v-model="filter" type="text" > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debounce="500" can be added to hold off on filterOpportunities() calls for 500 milliseconds to avoid flooding the server with REST API calls while the user is typing.
}) | ||
let results = [] | ||
|
||
this.$axios.get('/api/v1/opportunities/?search=' + this.filter.toLowerCase(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL encoding will be necessary to handle characters that cannot be in URLs or have a special meaning (like "&").
|
||
results = results.filter(o => { | ||
return o.date.toLowerCase().indexOf(this.filterDate.toLowerCase()) > -1 | ||
}) | ||
|
||
return results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this return value is unused and results
can be removed. The UI update happens when this.opportunities is assigned above.
Thank you, @alifhughes. I posted some comments if you or someone else want to work further on this pull request. |