CodeForPhilly / CodeForPhilly/codeforphilly-ng

Surface newsletter state on /api/auth/me (or self GET /api/people/:slug)

Abierto
#39 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
1
Forks
1
Merge medio
5 d 3 h
PR fusionados (30 d)
9

Descripción

Follow-up from [#38](https://github.com/CodeForPhilly/codeforphilly-ng/pull/38) (authoring-screens).

The Account settings screen has a working newsletter toggle that PATCHes `/api/people/:slug/newsletter`, but the read side never exposes the current opt-in state to the SPA. `GET /api/auth/me` returns the public Person shape (no newsletter); the people serializer hides newsletter from non-self callers.

Result: the Account screen defaults to `optedIn=false` and only reflects the server state after the user toggles once. That's a UX bug — a user who opted-in on a previous session sees a checkbox that lies until they touch it.

### Fix

Add `newsletter.optedIn` (and probably `email`) to the self-view of `GET /api/auth/me` (and/or `GET /api/people/:slug` for self). The `PATCH /api/people/:slug/newsletter` response already returns the full `newsletter` shape, so the data is available — the serializer just needs to include it for self.

### References

- [specs/screens/account.md](../specs/screens/account.md) — Newsletter card spec
- [specs/api/auth.md#get-apiauthme](../specs/api/auth.md) — "The PersonResponse for self includes `email` (fetched from PrivateProfile) and `newsletter` state." (already in the spec; just unimplemented)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.