2026-05-21backend

Server Actions introduced for post mutations

  • Change: app/lib/mutations.ts added with deletePost and updatePost as "use server" Server Actions. Both call the raw sql client directly.
  • Why: Viewer edit form and delete controls need admin-gated write paths that revalidate the home page cache.
  • Affected Modules: app/lib/mutations.ts, app/_component/fullscreen-viewer.tsx, app/_component/post-gallery.tsx
  • Trade-offs:
    • Pro: Server Actions co-locate mutation logic with server auth checks; no separate API route needed.
    • Con: Server Actions are harder to test in isolation than plain functions.