Is there an existing issue for this?
What happened?
The /toggle-favourite endpoint fetches the entire images table using db_get_all_images() to determine the favourite status of a single image. This causes O(n) complexity and unnecessary memory usage.
Record