Skip to content

Commit

Permalink
refactor(api): 🎨 Update returntype of findByTitle function to represe…
Browse files Browse the repository at this point in the history
…nt movies that are stored in the DB
  • Loading branch information
mathiasberggren committed Apr 20, 2024
1 parent 505794d commit 720cd5e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/api/src/movies/movies.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Controller, Get, Post, Body, Patch, Param, Delete, Query, BadRequestException } from '@nestjs/common'
import { Movie } from '@prisma/client'

import { MoviesService } from './movies.service'
import { CreateMovieDto } from './dto/create-movie.dto'
Expand All @@ -10,9 +11,7 @@ export class MoviesController {
constructor (private readonly moviesService: MoviesService, private readonly movieSearchService: MoviesSearchService) {}

@Get('search')
// TODO: change return type to Movie[] when the entity is defined
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async findByTitle (@Query('title') title: string): Promise<any> {
async findByTitle (@Query('title') title: string): Promise<Movie[]> {
return await this.movieSearchService.findByTitle(title)
}

Expand Down

0 comments on commit 720cd5e

Please sign in to comment.