feat(blog): add admin endpoint to list all blog posts with status filtering

This commit is contained in:
hamed
2026-07-23 22:21:14 +03:30
parent dab36058a3
commit 0cc51ee54f
5 changed files with 127 additions and 1 deletions
+19
View File
@@ -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.