Skip to the content.

Message retrieval and deletion

Admin messages expose list/delete; creation belongs to the public contact form. The UI sends DELETE immediately without confirmation or Undo. The response echoes the database but the UI does not use it to protect against concurrent backend switching.

sequenceDiagram
  actor U as Administrator
  participant P as Messages page
  participant R as Message handler
  participant S as Message service
  participant D as Selected MessageStore
  U->>P: Open page or change database
  P->>R: adminFetch GET messages
  Note over R,D: Global blog-store hook runs first
  R->>R: Authenticate and resolve database
  R->>D: Get cached message store
  R->>S: listContactMessages(store)
  S->>D: list()
  D-->>P: Records through service and handler
  U->>P: Delete message
  P->>R: Authenticated DELETE messages/id
  R->>R: Validate id and select database store
  R->>S: deleteContactMessage(store, id)
  S->>D: delete(id)
  alt Existed
    R-->>P: ok, id and database
    P->>P: Filter removed row from list
  else Missing
    R-->>P: 404
    P->>P: Show delete failure
  end

Source evidence