User tests: Successful: Unsuccessful:
Pull Request resolves #47740.
Add preprocessSaveData method to handle PATCH requests when no rules in the payload.
send a PATCH to /api/index.php/v1/users/levels/{id} that omits rules
{
"title": "ccTechnician"
}HTTP 200, response body shows rules = [0]. The previous rules array is destroyed silently.
only title is changed, rules is preserved.
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:
Webservices
PR-5.4-dev
|
||
| Category | ⇒ | JavaScript Unit Tests |
I have tested this item ✅ successfully on 516d1da
Tested Successfully!
Before the patch:
{
"errors": [
{
"title": "Field required: id"
}
]
}
And after the patch:
{
"links": {
"self": "http://localhost/joomla-cms/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "7",
"attributes": {
"id": 7,
"title": "aaTechnician",
"rules": [
1,
2
]
}
}
}
I have tested this item ✅ successfully on 516d1da
Tested Successfully!
Before the patch:
{
"errors": [
{
"title": "Field required: id"
}
]
}
And after the patch:
{
"links": {
"self": "http://localhost/joomla-cms/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "7",
"attributes": {
"id": 7,
"title": "aaTechnician",
"rules": [
1,
2
]
}
}
}
@adarshdubey03 Can it be that you have reported your test result in the wrong PR? This one here is still draft, and your test result fits better to #47748 .
I have not tested this item.
I have not tested this item.
| Labels |
Added:
Unit/System Tests
|
||
I have tested this item ✅ successfully on 516d1da
Tested Successfully!
Before the patch:
{
"errors": [
{
"title": "Field required: id"
}
]
}
And after the patch:
{
"links": {
"self": "http://localhost/joomla-cms/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "7",
"attributes": {
"id": 7,
"title": "aaTechnician",
"rules": [
1,
2
]
}
}
}
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47751.