Skip to content

docs(arcgis-rest-portal): fix incorrect documentation for searchGroupContent #1208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 7, 2025

Conversation

DoiMayank
Copy link
Contributor

What

This PR fixes the incorrect documentation for the searchGroupContent method in the arcgis-rest-portal module. The previous documentation incorrectly suggested passing a string as a parameter, but the method actually requires an options object containing q and groupId.

Why

The current documentation is misleading, causing confusion for developers trying to use this method correctly. This fix ensures the documentation aligns with the method's expected behavior.

How

  • Updated the JSDoc comment for the searchGroupContent function in packages/arcgis-rest-portal/src/search.ts.
  • Updated the example to correctly demonstrate passing an options object.

Context

Fixes #1205
Reference: searchGroupContent REST Documentation

Checklist

  • Updated the JSDoc comments for searchGroupContent.
  • Verified that the changes align with the REST documentation.
  • Ran npm test to ensure no existing functionality is broken.

@gavinr-maps gavinr-maps changed the title docs(arcgis-rest-portal): fix incorrect documentation for searchGroup docs(arcgis-rest-portal): fix incorrect documentation for searchGroupContent Mar 26, 2025
Copy link
Contributor

@gavinr-maps gavinr-maps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I have a few comments below. Also, the changes to CHANGELOG.md do not look related to this PR .. where did those come from? I think you can probably remove those changes from this PR.

Same for the changes to package.json and package-lock.json ... I do not think you should make version changes in the PR - our automatic release system will change those.

Comment on lines 39 to 45
* searchGroupContent({
* q: 'water',
* groupId: 'abc123'
* })
* .then(response => {
* console.log(response.total); // response.total => 355
* });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section looks good. I think you can remove the // response.total => 355 line since this is just a fake example the number 355 does not really make sense.

Comment on lines 49 to 51
* @param options.q - The search query (required).
* @param options.groupId - The ID of the group to search within (required).
* @param options.params - Additional search parameters (optional).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think you need to add these lines ... the automatic doc generator will link to ISearchGroupContentOptions properly as it does currently on https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-portal/searchGroupContent/ :
image

Deleted requested commented code.
Updated version to previous one
Updated version to previous one
Reverted back to previous changes
Deleted the requested ,reverted back to correct one
Copy link
Contributor Author

@DoiMayank DoiMayank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made in search.ts as requested.

Package.json, package-lock.json and CHANGELOG.md reverted back to original.

@gavinr-maps gavinr-maps self-requested a review March 26, 2025 17:32
Copy link
Contributor

@gavinr-maps gavinr-maps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @patrickarlt is this what you were envisioning for #1205?

@gavinr-maps gavinr-maps requested a review from patrickarlt March 26, 2025 17:33
Copy link
Contributor

@patrickarlt patrickarlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks @DoiMayank!

@gavinr-maps gavinr-maps merged commit b21d780 into Esri:main Apr 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve documentation for SearchGroupContent()
4 participants