feat: enhance search functionality to include parent names and related fields across categories
This commit is contained in:
@@ -53,17 +53,22 @@ List all services with pagination (admin view).
|
||||
|-------|------|----------|-------------|
|
||||
| `page` | integer | ❌ | Default: 1 |
|
||||
| `limit` | integer | ❌ | Default: 20 |
|
||||
| `search` | string | ❌ | Search in name |
|
||||
| `search` | string | ❌ | Matches `name`, `slug`, **or the related specialty's name** (case-insensitive `LIKE`) |
|
||||
| `specialty_id` | integer | ❌ | Filter by specialty |
|
||||
|
||||
### Response `200`
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": [ ... ],
|
||||
"data": [
|
||||
{ "id": 7, "uuid": "…", "name": "بوتاکس", "slug": "botox", "status": 1, "weight": 0,
|
||||
"specialty_id": 3, "specialty_name": "پوست و مو" }
|
||||
],
|
||||
"meta": { "totalRecords": 30, "totalPages": 2, "currentPage": 1 }
|
||||
}
|
||||
```
|
||||
- `specialty_name` is **admin-list only** — the public `GET /api/v1/doctor-services` does not return it.
|
||||
- Services without a specialty are still listed (the join is a `LEFT JOIN`).
|
||||
|
||||
### Errors
|
||||
| Code | HTTP | Description |
|
||||
|
||||
Reference in New Issue
Block a user