Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alifhughes
Copy link
Contributor

@alifhughes alifhughes commented Apr 21, 2021

  • 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
    ezgif com-gif-maker

@@ -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" >
Copy link
Collaborator

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(),
Copy link
Collaborator

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
Copy link
Collaborator

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.

@stefanha
Copy link
Collaborator

Thank you, @alifhughes. I posted some comments if you or someone else want to work further on this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants