Refactor code structure for improved readability and maintainability
This commit is contained in:
+7
-4
@@ -94,17 +94,19 @@ Create a new blog post.
|
||||
"body": "<p>محتوای کامل مقاله...</p>",
|
||||
"summary": "خلاصه کوتاه از مقاله",
|
||||
"tags": [1, 2],
|
||||
"status": "draft"
|
||||
"status": "draft",
|
||||
"image_url": "/uploads/blogs/blog_abc.jpg"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `title` | string | ✅ | Post title (slug auto-generated) |
|
||||
| `body` | string | ✅ | Full HTML body |
|
||||
| `body` | string | ✅ | Full HTML body (from the admin CKEditor) |
|
||||
| `summary` | string | ❌ | Short excerpt |
|
||||
| `tags` | integer[] | ❌ | Array of tag IDs |
|
||||
| `status` | string | ❌ | `"draft"` (default) or `"published"` |
|
||||
| `image_url` | string | ❌ | Cover image path returned by the upload endpoint |
|
||||
|
||||
### Response `201`
|
||||
```json
|
||||
@@ -158,11 +160,12 @@ Update a blog post.
|
||||
"body": "<p>محتوای جدید</p>",
|
||||
"summary": "خلاصه جدید",
|
||||
"tags": [1, 3],
|
||||
"status": "published"
|
||||
"status": "published",
|
||||
"image_url": "/uploads/blogs/blog_abc.jpg"
|
||||
}
|
||||
```
|
||||
|
||||
All fields optional.
|
||||
All fields optional. Send `image_url: ""` to clear the cover image.
|
||||
|
||||
### Response `200`
|
||||
Updated blog object.
|
||||
|
||||
Reference in New Issue
Block a user