Created
August 12, 2020 18:48
-
-
Save kop7/d088360fe8bf9ebf49a0e0fb091d818b to your computer and use it in GitHub Desktop.
Movie Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Get, Query } from '@nestjs/common'; | |
import { MovieService } from './movie.service'; | |
@Controller() | |
export class MovieController { | |
constructor(public readonly movieService: MovieService) {} | |
@Get('movies') | |
async getMovies(@Query('search') search: string) { | |
if (search !== undefined && search.length > 1) { | |
return await this.movieService.findMovies(search); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment