Good Day
I posted a similar question under the ArcGIS REST JS section. I'm running a query by username to try and fetch the folders that are under a user account, where is the function:
private getArcGISFolders(): Promise<ArcGISItem[] | Error>{
return new Promise((r, j) => {
const query = new PortalQueryParams({
query: `username: ${this._portal.user.username}`,
});
this._portal.queryUsers(query).then((queryResults) => {
this._folders = [];
if (!Array.isArray(queryResults.results)) {
j();
} else {
try {
queryResults.results?.forEach((folder) => {
console.log('Folder');
console.log(folder);
this._folders.push({
id: folder.id,
title: folder.title
})
})
} catch(error) {
j(error);
}
}
r(this._folders);
}).catch((error) => {
console.log('Query User - Error');
console.log(error);
j(error);
})
})
}
A couple of weeks ago this function was working fine, and I was getting the folders that a user had under their ArcGIS Account, and now I'm not. I noticed in the response that "access" is set to "public", which I think is what is causing the problem.
1. Is there a way to properly modify the access of the queryUser function?
2. Is this the right way to query for folders from ArcGIS?
Thanks