Lighter list presenter for /api/subjects (performance, future) #11

Open
opened 2026-06-06 01:25:07 +02:00 by myrmidex · 0 comments
Owner

Low priority — note for later.

SubjectPresenter::present() currently expands all ratings and computes aggregates for both the list endpoint (GET /api/subjects) and the detail endpoint (GET /api/subjects/{id}). This means the map-load fetches every rating for every subject just to draw pins — fine at current scale, wasteful as data grows.

Scope: Add a lighter presentForList() method to SubjectPresenter that returns only the fields needed for map pins (id, name, lat, lng) without expanding ratings. Use it in the index action; keep the full present() for the show action.

Size: small

**Low priority — note for later.** `SubjectPresenter::present()` currently expands all ratings and computes aggregates for both the list endpoint (`GET /api/subjects`) and the detail endpoint (`GET /api/subjects/{id}`). This means the map-load fetches every rating for every subject just to draw pins — fine at current scale, wasteful as data grows. **Scope:** Add a lighter `presentForList()` method to `SubjectPresenter` that returns only the fields needed for map pins (id, name, lat, lng) without expanding ratings. Use it in the `index` action; keep the full `present()` for the `show` action. **Size: small**
myrmidex added the
enhancement
label 2026-06-06 01:25:07 +02:00
myrmidex added this to the v0.1.0 MVP milestone 2026-06-08 18:02:32 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/rater#11
No description provided.