Skip to content

47 45 search logic on filmer#62

Merged
Fagerdahl merged 7 commits intomainfrom
47-45-search-logic-on-filmer
Jun 4, 2025
Merged

47 45 search logic on filmer#62
Fagerdahl merged 7 commits intomainfrom
47-45-search-logic-on-filmer

Conversation

@Fagerdahl
Copy link
Collaborator

@Fagerdahl Fagerdahl commented Jun 2, 2025

Pull Request Type

Please check the type of change your PR introduces:

  • Feature (a new feature for the project)
  • Fix (a bug fix)
  • Chore (updating grunt tasks etc; no production code change)
  • Refactor (refactoring production code)
  • Docs (changes to the documentation)
  • Style (formatting, missing semi colons, etc; no production code change)
  • Test (adding missing tests, refactoring tests; no production code change)

Description

This PR implements a full backend-powered search feature for movies.
Users can now search for movies stored in our database directly from the frontend.
Features

  • Backend search using query parameter (/api/movies?q=)
  • Users can press Enter to trigger a search
  • Clickable movie results with poster display
  • Debounce logic to reduce API calls
  • Friendly "no results found" message

Motivation and Context

[This provides a smoother UX and overall better performance, since the search logic is handled on the backend instead of filtering on the client side.]

How Has This Been Tested?

[Manually like this:

  1. Got to the FILMER page

  2. Typed a movie title in the search field

  3. Pressed Enter or clicked the "Sök" button

  4. Confirmed that:

  • Matching results showed up as movie cards
  • Clicking a result routes us to our movie detail page
  • No matching title = A message appeared]

Screenshots (if appropriate):

[Skärmbild 2025-06-02 184953
Skärmbild 2025-06-02 185015]

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have named this PR according to following naming convention: #[issue-number] PR description

Additional Information:

[Add any other information about the PR here]

Related Issues:

[Link any related issues here]

@Fagerdahl Fagerdahl linked an issue Jun 2, 2025 that may be closed by this pull request
@Fagerdahl
Copy link
Collaborator Author

Fagerdahl commented Jun 2, 2025

CI fault- Working on it. Suggestions?

@AlexCode-dot
Copy link
Owner

AlexCode-dot commented Jun 2, 2025

CI fault- Working on it. Suggestions?

I can check it out right now!

Thanks. The exports listed at the bottom are unneccessary. Ignore them, I will delete them or remove them out of the functions. I don't know which approach to take atm

@AlexCode-dot
Copy link
Owner

Okey change this inside the movies.test.js file:

  • Screenshot 2025-06-02 at 21 22 17

Also remove this line at the top:

  • import { findMovieById } from '@/lib/db/movieDbService'

You can also do the same with the other test files, inside the screenings.test.js file, remove:

  • import { getScreeningById } from '@/lib/db/screeningDbService'

And the same in the rooms.test.js file, remove:

  • import { getRoomById } from '@/lib/db/roomDbService'

They must have been added in a recent PR by misstake, we dont need to import mocked functions if we only use them as mocked.

@vercel
Copy link

vercel bot commented Jun 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kino-next-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2025 5:13pm

@Fagerdahl
Copy link
Collaborator Author

image
Lalala B-)

@Fagerdahl
Copy link
Collaborator Author

HappyBirthdayGIF

@Fagerdahl
Copy link
Collaborator Author

Fagerdahl commented Jun 3, 2025

Okey change this inside the movies.test.js file:

  • Screenshot 2025-06-02 at 21 22 17

Also remove this line at the top:

  • import { findMovieById } from '@/lib/db/movieDbService'

You can also do the same with the other test files, inside the screenings.test.js file, remove:

  • import { getScreeningById } from '@/lib/db/screeningDbService'

And the same in the rooms.test.js file, remove:

  • import { getRoomById } from '@/lib/db/roomDbService'

They must have been added in a recent PR by misstake, we dont need to import mocked functions if we only use them as mocked.

Thankssss ❤️

Copy link
Owner

@AlexCode-dot AlexCode-dot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! Ready for merge :)

@Fagerdahl Fagerdahl merged commit 60b56eb into main Jun 4, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4.5 Search logic on "filmer"

2 participants