Refactor code structure for improved readability and maintainability

This commit is contained in:
hamed
2026-06-19 00:54:34 +03:30
parent 2943e29663
commit ccfb3391f2
8 changed files with 18046 additions and 48 deletions
+7 -4
View File
@@ -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.