mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix scope id issue
This commit is contained in:
parent
50fbb5120a
commit
9ced84a2df
@ -432,16 +432,14 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|||||||
|
|
||||||
//Set scope id which related to the scope key
|
//Set scope id which related to the scope key
|
||||||
JSONArray scopeList = (JSONArray) scopeObject.get("list");
|
JSONArray scopeList = (JSONArray) scopeObject.get("list");
|
||||||
JSONObject jsonObject = null;
|
|
||||||
for (int i = 0; i < scopeList.length(); i++) {
|
for (int i = 0; i < scopeList.length(); i++) {
|
||||||
JSONObject scopeObj = null;
|
JSONObject scopeObj = null;
|
||||||
scopeObj = scopeList.getJSONObject(i);
|
scopeObj = scopeList.getJSONObject(i);
|
||||||
if (scopeObj.getString("name").equals(scopeMapping[2] != null ?
|
if (scopeObj.getString("name").equals(scopeMapping[2] != null ?
|
||||||
StringUtils.trim(scopeMapping[2]) : StringUtils.EMPTY)) {
|
StringUtils.trim(scopeMapping[2]) : StringUtils.EMPTY)) {
|
||||||
jsonObject = scopeObj;
|
scope.setId(scopeObj.getString("id"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scope.setId(jsonObject.getString("id"));
|
|
||||||
|
|
||||||
if (publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo, scope.getKey())) {
|
if (publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo, scope.getKey())) {
|
||||||
publisherRESTAPIServices.updateSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
publisherRESTAPIServices.updateSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user