feat(blog): add admin endpoint to list all blog posts with status filtering
This commit is contained in:
@@ -62,6 +62,25 @@ List published blog posts.
|
||||
|
||||
---
|
||||
|
||||
## GET `/api/v1/admin/blogs`
|
||||
|
||||
List blog posts of **all** statuses for the admin panel. The public `GET /api/v1/blogs` only returns `published` posts, so the admin panel must use this endpoint to see drafts and archived posts.
|
||||
|
||||
**Permission:** `ROLE_ADMIN`
|
||||
|
||||
### Query Parameters
|
||||
| Param | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `page` | integer | ❌ | 1 | Page number |
|
||||
| `limit` | integer | ❌ | 20 (max 50) | Items per page |
|
||||
| `status` | string | ❌ | — | Filter by `draft` / `published` / `archived`. Omit for all. |
|
||||
| `search` | string | ❌ | — | Title search (LIKE). |
|
||||
|
||||
### Response `200`
|
||||
Paginated (`{ data:[...], meta:{...} }`), each item the blog list shape (includes `status`, `review_status`, `scheduled_at`, `representation`, `city`).
|
||||
|
||||
---
|
||||
|
||||
## GET `/api/v1/blog/{slug}`
|
||||
|
||||
Get a single blog post by slug.
|
||||
|
||||
Reference in New Issue
Block a user