Skip to content

News API Improvements#222

Merged
gregv merged 2 commits into
mainfrom
develop
May 17, 2026
Merged

News API Improvements#222
gregv merged 2 commits into
mainfrom
develop

Conversation

@gregv
Copy link
Copy Markdown
Contributor

@gregv gregv commented May 17, 2026

No description provided.

gregv and others added 2 commits May 17, 2026 08:24
Backs the new frontend /admin/blog CMS
(opportunity-hack/frontend-ohack.dev#293). The existing public POST
/api/messages/news with X-Api-Key auth is untouched so the Slack
integration keeps working.

- New routes under /api/messages/admin/news (all gated with
  volunteer.admin via auth.require_org_member_with_permission):
  - GET    /admin/news?limit=&status=  — admin list, includes drafts
  - POST   /admin/news                  — create (default status=draft,
    skips OpenAI image-gen when featured_image supplied)
  - PATCH  /admin/news/<id>             — partial update (allowlisted
    fields only, clears get_news cache)
  - DELETE /admin/news/<id>             — hard delete

- services/news_service.py adds admin_create_news, admin_update_news,
  admin_delete_news, admin_list_news plus _ADMIN_ALLOWED_KEYS allowlist
  and _is_publicly_visible filter so the public get_news drops
  status=draft|archived (over-fetches 3x to keep the post-filter count).

- common/utils/firebase.py adds update_news_partial, delete_news, and
  get_all_news_admin.

New optional fields on a news doc (all optional, legacy docs unchanged):
content_markdown, content_format, featured_image, author, tags, slug,
status, published_at, seo{}, last_updated_by, created_by.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…-3ca3eb-blog-admin

[Blog] Admin-gated CRUD routes for /news
@gregv gregv merged commit a875c2b into main May 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant