Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.get('/search', function () {
- let { searchWord } = this.params;
- database.collection('movies')
- .get()
- .then(response => {
- this.movies = response.docs
- .map(movie => { return { ...movie.data(), id: movie.id } })
- .filter(movie => movie.title.toLowerCase().includes(searchWord.toLowerCase()));
- extendContext(this)
- .then(function () {
- this.partial('/templates/home.hbs')
- })
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement