Advertisement
divanov94

Untitled

Dec 5th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this.get('/search', function () {
  2.         let { searchWord } = this.params;
  3.  
  4.         database.collection('movies')
  5.             .get()
  6.             .then(response => {
  7.                 this.movies = response.docs
  8.                     .map(movie => { return { ...movie.data(), id: movie.id } })
  9.                     .filter(movie => movie.title.toLowerCase().includes(searchWord.toLowerCase()));
  10.                 extendContext(this)
  11.                     .then(function () {
  12.                         this.partial('/templates/home.hbs')
  13.                     })
  14.             })
  15.     })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement