Skip to content

profile: use dedicated user-contests endpoint instead of client-side filter#14263

Closed
dylanjeffers wants to merge 2 commits intomainfrom
claude/laughing-antonelli-1b2a6b
Closed

profile: use dedicated user-contests endpoint instead of client-side filter#14263
dylanjeffers wants to merge 2 commits intomainfrom
claude/laughing-antonelli-1b2a6b

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Adds useUserContests hook backed by the new GET /v1/users/{id}/contests endpoint and points the desktop + mobile profile Contests tabs at it
  • Removes the previous workaround that paged through the global events/remix-contests list and filtered each row by event.userId === profile.user_id, which silently truncated artists whose hosted contests sat beyond the auto-paginate cap
  • Regenerates SDK types from the updated swagger spec (users.getContestsByUser); also picks up the feed tag that was already in the swagger but not yet in the generated client

The new endpoint returns the same payload shape (data + related.users / tracks / entry_counts) as the global one, so React Query priming logic is reused — only the call site changes.

API change: audius-protocol/api#790 — must merge and deploy first.

Test plan

  • Visit a profile that hosts active and ended contests — both render without paging through the global list
  • Visit a profile that hosts only ended contests — they appear (previously hidden once they fell off page 1 of the global list)
  • Visit a profile with no contests — empty state renders
  • Confirm ContestCard entry-count badges populate without an extra request per card (related.entry_counts priming still works)

🤖 Generated with Claude Code

dylanjeffers and others added 2 commits May 6, 2026 13:13
Match the union of filters (genre, mood, key, bpm, isPremium,
hasDownloads, isVerified) on both web and mobile so the All tab
isn't forced to clear filters when switching off a sub-category.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…filter

The profile "Contests" tab was paginating the global remix-contest list
and filtering each row by host userId, which forced multiple page fetches
and still missed artists whose hosted contests sat beyond the auto-paginate
safety cap.

Switches the desktop and mobile tabs to a new `useUserContests` hook
backed by `GET /v1/users/{id}/contests` (SDK: `users.getContestsByUser`),
which returns the artist's contests directly. Same render path as before
since the response shape mirrors `GET /v1/events/remix-contests`.

Also pulls in regenerated SDK types for the new endpoint and sweeps in
the new `feed` tag (Feed for-you) that was already in the swagger spec.

API repo: audius-protocol/api#790

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 2ec3853

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@dylanjeffers
Copy link
Copy Markdown
Contributor Author

Duplicate of #14261 — closing in favor of that one

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.

1 participant