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 |
|
||||
|
||||
@@ -88,11 +88,11 @@ List all cities with pagination (admin view).
|
||||
|-------|------|----------|-------------|
|
||||
| `page` | integer | ❌ | Default: 1 |
|
||||
| `limit` | integer | ❌ | Default: 20 |
|
||||
| `search` | string | ❌ | Search in name |
|
||||
| `search` | string | ❌ | Matches `name`, `site_name`, `domain`, **or the parent province's name** (case-insensitive `LIKE`) |
|
||||
| `province_id` | integer | ❌ | Filter by province |
|
||||
|
||||
### Response `200`
|
||||
Paginated city list.
|
||||
Paginated city list. Each row already carries `province_name` alongside `province_id`.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -86,16 +86,23 @@ List all specialties with pagination (admin view — includes inactive).
|
||||
|-------|------|----------|-------------|
|
||||
| `page` | integer | ❌ | Default: 1 |
|
||||
| `limit` | integer | ❌ | Default: 20 |
|
||||
| `search` | string | ❌ | Search in name |
|
||||
| `search` | string | ❌ | Matches `name`, `slug`, **or the parent specialty's name** (case-insensitive `LIKE`) |
|
||||
| `sort` / `order` | string | ❌ | `sort=id` with `order=asc\|desc`; otherwise ordered by weight then name |
|
||||
|
||||
### Response `200`
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": [ ... ],
|
||||
"data": [
|
||||
{ "id": 12, "uuid": "…", "name": "لیزر درمانی", "slug": "laser", "status": 1, "weight": 0,
|
||||
"parent_id": 3, "parent_name": "پوست و مو" }
|
||||
],
|
||||
"meta": { "totalRecords": 50, "totalPages": 3, "currentPage": 1 }
|
||||
}
|
||||
```
|
||||
- `parent_name` is **admin-list only** — the public `GET /api/v1/specialties` does not return it.
|
||||
It exists because searching by parent can return a child whose parent is not on the current page,
|
||||
so the client cannot resolve the name from its own list.
|
||||
|
||||
### Errors
|
||||
| Code | HTTP | Description |
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ List all tags with pagination (admin view — includes inactive).
|
||||
|-------|------|----------|-------------|
|
||||
| `page` | integer | ❌ | Default: 1 |
|
||||
| `limit` | integer | ❌ | Default: 20 |
|
||||
| `search` | string | ❌ | Search in name |
|
||||
| `search` | string | ❌ | Matches `name` or `slug` (case-insensitive `LIKE`). Tags have no parent. |
|
||||
|
||||
### Response `200`
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user