User tests: Successful: Unsuccessful:
Pull Request for Issue # .
add filter state to categories endpoints
GET {{base_path}}/api/index.php/v1/banners/categories?filter[state]=1
GET {{base_path}}/api/index.php/v1/banners/categories?filter[state]=0
GET {{base_path}}/api/index.php/v1/contacts/categories?filter[state]=1
GET {{base_path}}/api/index.php/v1/contacts/categories?filter[state]=0
GET {{base_path}}/api/index.php/v1/content/categories?filter[state]=1
GET {{base_path}}/api/index.php/v1/content/categories?filter[state]=0
N/A
you can filter categories from state = published or unpublished
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Labels |
Added:
PR-6.1-dev
|
||
| Category | ⇒ | JavaScript Unit Tests |
| Labels |
Added:
Unit/System Tests
|
||
| Title |
|
||||||
| Labels |
Added:
Feature
Webservices
|
||
I have tested this item ✅ successfully on 7bab005
Hi @alikon, I think this time I was successful.
Did a complete reinstall of Joomla 6.1ß2, and WITHOUT the PR whether:
https://www.domain.com/_j61b2/api/index.php/v1/contacts/categories?filter[state]=0 or
https://www.domain.com/_j61b2/api/index.php/v1/contacts/categories?filter[state]=1
I got the same:
{
"links": {
"self": "https://www.domain.com/_j61b2/api/index.php/v1/contacts/categories?filter[state]=0"
},
"data": [
{
"type": "categories",
"id": "4",
"attributes": {
"id": 4,
"title": "Uncategorised",
"alias": "uncategorised",
"note": "",
"published": 1,
"access": 1,
"checked_out": null,
"checked_out_time": null,
"created_user_id": 241,
"parent_id": 1,
"level": 1,
"lft": 5,
"rgt": 6,
"language": "*",
"description": "",
"language_title": null,
"language_image": null,
"editor": null,
"access_level": "Public",
"author_name": "Emmanuel Lemor",
"count_trashed": 0,
"count_unpublished": 0,
"count_published": 0,
"count_archived": 0
}
}
],
"meta": {
"total-pages": 1
}
}
WITH the PR applied:
for CONTACTS:
https://www.domain.com/_j61b2/api/index.php/v1/contacts/categories?filter[state]=0, I get:
{
"links": {
"self": "https://www.domain.com/_j61b2/api/index.php/v1/contacts/categories?filter[state]=0"
},
"data": [],
"meta": {
"total-pages": 0
}
}
and with
https://www.domain.com/_j61b2/api/index.php/v1/contacts/categories?filter[state]=1, I get:
{
"links": {
"self": "https://www.domain.com/_j61b2/api/index.php/v1/contacts/categories?filter[state]=1"
},
"data": [
{
"type": "categories",
"id": "4",
"attributes": {
"id": 4,
"title": "Uncategorised",
"alias": "uncategorised",
"note": "",
"published": 1,
"access": 1,
"checked_out": null,
"checked_out_time": null,
"created_user_id": 241,
"parent_id": 1,
"level": 1,
"lft": 5,
"rgt": 6,
"language": "*",
"description": "",
"language_title": null,
"language_image": null,
"editor": null,
"access_level": "Public",
"author_name": "Emmanuel Lemor",
"count_trashed": 0,
"count_unpublished": 0,
"count_published": 0,
"count_archived": 0
}
}
],
"meta": {
"total-pages": 1
}
}
For BANNERS
https://www.domain.com/_j61b2/api/index.php/v1/banners/categories?filter[state]=0, I get:
{
"links": {
"self": "https://www.domain.com/_j61b2/api/index.php/v1/banners/categories?filter[state]=0"
},
"data": [],
"meta": {
"total-pages": 0
}
}
https://www.domain.com/_j61b2/api/index.php/v1/banners/categories?filter[state]=1, I get:
{
"links": {
"self": "https://www.domain.com/_j61b2/api/index.php/v1/banners/categories?filter[state]=1"
},
"data": [
{
"type": "categories",
"id": "3",
"attributes": {
"id": 3,
"title": "Uncategorised",
"alias": "uncategorised",
"note": "",
"published": 1,
"access": 1,
"checked_out": null,
"checked_out_time": null,
"created_user_id": 241,
"parent_id": 1,
"level": 1,
"lft": 3,
"rgt": 4,
"language": "*",
"description": "",
"language_title": null,
"language_image": null,
"editor": null,
"access_level": "Public",
"author_name": "Emmanuel Lemor",
"count_trashed": 0,
"count_unpublished": 0,
"count_published": 0,
"count_archived": 0
}
}
],
"meta": {
"total-pages": 1
}
}
@alikon hi there, BEFORE applying the Patch, I get a 200 OK with:
https://www.domain.com/_j61a4/api/index.php/v1/banners/categories?filter[state]=1
https://www.domain.com/_j61a4/api/index.php/v1/banners/categories?filter[state]=0
https://www.domain.com/_j61a4/api/index.php/v1/contacts/categories?filter[state]=1
https://www.domain.com/_j61a4/api/index.php/v1/contacts/categories?filter[state]=0
...
{
"links": {
"self": "https://www.domain.com/_j61a4/api/index.php/v1/contacts/categories?filter[state]=0"
},
"data": [],
"meta": {
"total-pages": 0
}
}
and the same thing AFTER applying the Patch.
:-(