JamesReviewsMusic
JRM-3Fix genre filter being dropped when searching albums
Description
In AlbumModel.getPaginatedAlbums (backend/src/api/models/Album.ts), the query starts with a .where() for the genre filter and then calls .where() again to add the search filter. Drizzle's .where() replaces the previous condition instead of combining them, so when both a genre filter and a search term are set, the genre filter is silently thrown away and the search runs against all albums.
The let q: any cast is what allows the second .where() call to compile at all, so that should go too.
- Build both conditions up front and pass them through a single
.where()withand() - Remove the
anycast so Drizzle's types can catch this in future
Sub-tickets
0No sub-tickets yet.
Links
No links.
Comments
0No comments yet.