Skip to the content.

Blog create, update and publication

Publication is a status update, not a deployment or review queue. draft→published sets publishedAt, published→draft clears it, remaining published retains it. Creation defaults to draft. SQL protects unique slug; Dynamo checks a slug GSI then writes by ID, not an atomic slug claim. Updates have no optimistic revision check in the reviewed path. Blog deletion uses a native confirm dialog, authenticated DELETE and then navigation to the list.

Legend: all drawn relationships are source-verified.

sequenceDiagram
  actor U as Administrator
  participant P as Blog editor
  participant R as Post route
  participant A as Injected AdminBlogApi
  participant V as Post service and parser
  participant S as Selected BlogPostStore
  U->>P: Edit fields and draft/published status
  P->>R: POST new or PUT id via adminFetch
  Note over R,S: Request hook already selected cached store
  R->>R: Read body then requireAdminBlog auth
  R->>A: Create or update
  A->>V: Delegate with selected store
  V->>V: Validate fields and normalize slug
  alt Invalid body
    V-->>R: Failure mapped to 400
  else Valid
    V->>S: create or update
    S->>S: Resolve timestamps and publication fields
    alt Slug conflict or missing update id
      S-->>V: Conflict error or null
      V-->>R: 409 or 404
    else Saved
      S-->>R: BlogPost through facade
      R-->>P: Record
      P->>P: New post navigates to id, edit shows success
    end
  end

Source evidence