CodeForPhilly / CodeForPhilly/codeforphilly-ng

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

Open
#39 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1
Forks
1
Avg merge
5d 3h
Merged PRs (30d)
9

Description

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)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.