Skip to content

chore(clerk-js): Remove fallback data for paginated endpoint methods - #2491

Merged
panteliselef merged 2 commits into
mainfrom
elef/SDK-1130
Jan 9, 2024
Merged

chore(clerk-js): Remove fallback data for paginated endpoint methods#2491
panteliselef merged 2 commits into
mainfrom
elef/SDK-1130

Conversation

@panteliselef

Copy link
Copy Markdown
Contributor

Description

Remove fallback data and allow promise to throw for paginated endpoint methods.
Affected methods:

  • Organization.getDomains
  • Organization.getInvitations
  • Organization.getMembershipRequests
  • Organization.getMemberships
  • User.getOrganizationInvitations
  • User.getOrganizationSuggestions
  • User.getOrganizationMemberships

The react hooks will continue to fallback to total_count:0 and data = [] in case of an error, but the isError property will be correctly populated as true

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

@panteliselef
panteliselef requested a review from dimkl January 5, 2024 10:42
@changeset-bot

changeset-bot Bot commented Jan 5, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ccf6411

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@panteliselef panteliselef self-assigned this Jan 5, 2024
};
});
}).then(res => {
// TODO: Fix typing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❓ is this different from the above as unknown as ClerkPaginatedResponse... ? I think we should remove this TODO or add also to the other refs of this PR.
Let's also add a ticket to make this refactoring part of the v6 project

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe we already have one. It is a general issue with BaseResource._fetch and type inference.

@panteliselef
panteliselef added this pull request to the merge queue Jan 9, 2024
Merged via the queue into main with commit 57e0972 Jan 9, 2024
@panteliselef
panteliselef deleted the elef/SDK-1130 branch January 9, 2024 11:13
dimkl added a commit to clerk/clerk-docs that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants