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

Open Beginner friendly
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api, backend

Research direction

Start with specs/api/auth.md#get-apiauthme and specs/screens/account.md, then trace the serializer used by GET /api/auth/me and the self view of GET /api/people/:slug. The change is done when the self response includes newsletter.optedIn and email, matching the documented PersonResponse and the newsletter PATCH response shape.

Written by the indexing model from the issue text.

Description

Follow-up from #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
Dominant language
TypeScript
Stars
1
Forks
1
Avg merge
1d 20h
Merged PRs (30d)
25

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CodeForPhilly/codeforphilly-ng

All issues in CodeForPhilly/codeforphilly-ng

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.