jikan-rest icon indicating copy to clipboard operation
jikan-rest copied to clipboard

🐛 API Returns Empty Response When 'score' and 'producers' Parameters are Used Together

Open mirzaahmedov opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

The API returns an empty response when both the 'score' and 'producers' query parameters are included in the request.

Expected Behavior

The API should return a response containing relevant data, filtered based on the provided 'score' and 'producers' query parameters.

Steps To Reproduce

Make a request to the API endpoint with both the 'score' and 'producers' query parameters set. Observe that the API response is empty.

Environment

- OS: Linux
- Browser: Brave

Anything else?

API Endpoint: https://api.jikan.moe/v4/anime Query Parameters: score: 8 producers: 11 Example Request: https://api.jikan.moe/v4/anime?score=8&producers=11

screenshot

mirzaahmedov avatar Feb 15 '24 19:02 mirzaahmedov

Good catch. Meanwhile, a working alternative would be this: https://api.jikan.moe/v4/anime?min_score=8&producers=11

irfan-dahir avatar Feb 15 '24 19:02 irfan-dahir

Possible cause: we use $query->whereRaw() for the producers filter, which obliterates other calls to the query builder.

pushrbx avatar Feb 15 '24 22:02 pushrbx