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 19, 2024
1 parent aa6877b commit 3c3fbee
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 3c3fbee

Please sign in to comment.