Unnecessary (??) ngRest request when changing states
What steps will reproduce the problem?
1. Navigate to Settings -> Layouts.
At least two XHR requests performed:
- GET http://luyadev/admin/api-cms-layout/list?ngrestCallType=list&fields=id,id,name,json_config,view_file&sort=-id&page=1
- GEThttp://luyadev/admin/api-cms-layout/unlock
2. Navigate to Themes
There are 5 XHR request perfomed:
- GET http://luyadev/admin/api-cms-layout/list?ngrestCallType=list&fields=id,id,name,json_config,view_file&sort=-id&page=1
- GET http://luyadev/admin/api-cms-layout/unlock
- GET http://luyadev/cmsadmin/theme/index
- GET http://luyadev/admin/api-cms-theme/services?ngrestCallType=services&fields=id
- GET http://luyadev/admin/api-cms-theme/list?ngrestCallType=list&expand=name,parentTheme&fields=id,id,name,is_default,base_path,parentTheme&sort=-id&page=1
As far as I understand, the second request releases the lock from the current user, if any. But what the purpose of the first request?
Additional infos
| Q | A |
|---|---|
| LUYA Admin Version | 4.1.0 (before to replacement in menu) |
| PHP Version | 7.4.13 |
| Platform | Apache |
| Operating system | Windows |
You mean the second GET http://luyadev/admin/api-cms-layout/list?ngrestCallType=list&fields=id,id,name,json_config,view_file&sort=-id&page=1:
This is very hard to debug, and yes what you are saying is absolute true, this second requests makes no sense at all. This is maybe because when leaving this angular controller the state changes somewhere which triggers a final $scope.loadList something like this:
https://github.com/luyadev/luya-module-admin/blob/master/src/resources/js/controllers.js#L521-L527
Yes, that's exactly what I meant ("first" refers to queries after navigating to "Themes").
Do you have time for some "console.logs"? I would then try to fix it.
Yes. What do you want me to do?