The API gives me the wrong average rating

Database & APIs

The API gives me the wrong average rating. I created a superbase function that would calculate the average rating for a certain product, for example. When I make a test SQL query through Editor, it returns the correct value. But through the API, it is completely different.

What have you tried so far?

Recreated the API request and function

Did you check FlutterFlow's Documentation for this topic?
No
2