question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom portal not being used when set with `setDefaultRequestOptions()`

See original GitHub issue

Setting a custom portal with IRequestOptions via setDefaultRequestOptions() is not working for me; making calls to arcgis.com instead of the custom portal. Looks like it should be mixing it in: https://github.com/Esri/arcgis-rest-js/blob/master/packages/arcgis-rest-request/src/request.ts#L37-L47 and https://github.com/Esri/arcgis-rest-js/blob/master/packages/arcgis-rest-request/src/request.ts#L195. I’ve set other IRequestOptions with setDefaultRequestOptions() to test and they are being successfully mixed in. Is this not the proper method for setting a custom portal? Or is there something I’m missing in the portal package to do so? Or?

And a mostly unrelated question for you Esri folks that work with portal a lot. Is there a simple query to get items by folder id? I looked at how portal content fetches items for a folder. It makes several pretty complex queries and ultimately queries the item ids to display. I’m hoping there’s an easier way but the lack of a function in the portal package has me thinking not. Thanks.

Edit: ownerfolder: <ID> works just fine if you remember to pass auth with the request.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
COV-GIScommented, May 21, 2020

Not at this time. But…

setDefaultRequestOptions({
  portal: 'https://<URL>/portal/sharing/rest/'
});

searchItems('ownerfolder: ea19...91ac').then();

// request made to arcgis.com
searchItems({
  q: 'ownerfolder: ea19...91ac',
  portal: 'https://<URL>/portal/sharing/rest/'
}).then();

// request made to custom portal url

And any custom request options are inaccessible. https://github.com/Esri/arcgis-rest-js/blob/master/packages/arcgis-rest-request/src/request.ts#L15

If time permits I may PR getDefaultRequestOptions() and getFolderItems().

1reaction
patrickarltcommented, Jun 5, 2020

Reopening this. I think that anonymous requests with a portal set with setDefaultRequestOptions should still work since people might use this to access public data on their own portals.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade from v2 to v3 | ArcGIS REST JS
Currently only searchItems() and searchGroups() accept SearchQueryBuilder as an input, ... include a custom option, you can use setDefaultRequestOptions() .
Read more >
platformSelf | API Reference | ArcGIS REST JS
When a client app boots up, it will know its clientId and the redirectUri for use in the normal /oauth/authorize pop-out oAuth flow....
Read more >
How To Make CUSTOM PORTALS In Minecraft! - YouTube
In this video I talk about how you can create custom portals that lead to custom dimensions using a data pack!If you find...
Read more >
RCON Administration tool designed for use with Garry's Mod ...
To check my servers without being physically on them, I had to either go to clunky. URLs not built for mobile devices or...
Read more >
Device Policy-14.55.06.v37_com.google.android.apps.work ...
Not all malicious and suspicious indicators are displayed. ... Has the ability to get the wifi MAC address (may be used to fingerprint...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found