You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add ImageVariants concern for responsive image URLs
- Update PropertiesController with include_images=variants support
- Add E2E tests for all new API endpoints (favorites, saved_searches, locales, facets)
- Mark all BACKEND_WORK_FOR_JS_CLIENTS.md checklist items complete
- Update public_frontend_functionality.md with new API documentation
## 16) Gaps & Suggested API Additions for JS Clients
152
-
- Favorites (server): add CRUD endpoints for saved properties (`/api_public/v1/favorites`) mirroring `/my/favorites` flows, including manage/unsubscribe tokens and price-change flags. Needed to avoid scraping HTML modals.
153
-
- Saved searches: add CRUD + verify/unsubscribe endpoints for saved search definitions (`/api_public/v1/saved_searches`) returning manage tokens and alert frequencies.
154
-
- Page parts feed: extend Pages API to optionally include resolved page-part data (ordered, visible-only) plus rendered Liquid-safe JSON so headless clients can render page sections without duplicating composition logic. Consider `include_parts=true` flag.
155
-
- Search facets: add lightweight `/api_public/v1/search/facets` (counts per type/zone/locality/features) to avoid heavy full-search calls when building filter UIs.
156
-
- CDN/cache hints: include `Cache-Control/ETag` on static-ish endpoints (theme, site_details, links, search/config, translations) and return `last_modified` fields for client caching. Consider `If-None-Match` handling.
157
-
- Map tiles/meta: expose map defaults (tile URL, attribution, default zoom, scroll setting) via theme or site details to keep client and SSR behavior aligned.
158
-
- Language/locale list: add `/api_public/v1/locales` returning enabled locales and default locale per site, to avoid hardcoding language options in clients.
159
-
- Media variants: for properties and testimonials, include explicit image variant URLs (thumb, medium, full) to let clients pick responsive sizes without guessing.
151
+
## 16) Additional Public APIs for JS Clients
152
+
153
+
The following APIs complete the headless client support:
154
+
155
+
### Favorites API
156
+
Full CRUD for server-persisted favorites with token-based access:
-`GET /api_public/v1/properties?include_images=variants` - Includes `images[]` with `thumbnail/small/medium/large/original` URLs
199
+
200
+
### Caching
201
+
All endpoints include appropriate `Cache-Control` and ETag headers via [cacheable.rb](app/controllers/concerns/api_public/cacheable.rb).
160
202
161
203
## 17) Performance & Caching Guidance for JS Clients
162
204
- Use ETags / Cache-Control: theme, site_details, translations, links, search/config are good candidates for long-lived caching with revalidation; properties/search should set short TTL + ETag.
0 commit comments