Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from Z-Jais/master
Browse files Browse the repository at this point in the history
Change anime search by name method
  • Loading branch information
Ziedelth authored Oct 21, 2022
2 parents 450055e + 33af15a commit e37bb9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/fr/ziedelth/controllers/AnimeController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ object AnimeController : IController<Anime>("/animes") {

try {
val query = session.createQuery(
"FROM Anime a WHERE a.country.tag = :tag AND LOWER(name) LIKE CONCAT('%', :name, '%') ",
// "FROM Anime a WHERE a.country.tag = :tag AND LOWER(name) LIKE CONCAT('%', :name, '%')",
"SELECT DISTINCT anime FROM Episode e WHERE e.anime.country.tag = :tag AND LOWER(e.anime.name) LIKE CONCAT('%', :name, '%') ORDER BY e.anime.name",
Anime::class.java
)
query.maxResults = 10
query.setParameter("tag", country)
query.setParameter("name", name.lowercase())
call.respond(query.list() ?: HttpStatusCode.NotFound)
Expand Down

0 comments on commit e37bb9e

Please sign in to comment.