Skip to content

onboarding: Separate submit for review to other endpoint#10837

Open
Yopi wants to merge 3 commits intomainfrom
Yopi/onboarding-name-errors
Open

onboarding: Separate submit for review to other endpoint#10837
Yopi wants to merge 3 commits intomainfrom
Yopi/onboarding-name-errors

Conversation

@Yopi
Copy link
Copy Markdown
Contributor

@Yopi Yopi commented Apr 7, 2026

Split save details and submit for review into two separate endpoints. This clarifies the button, and makes sure that submitting for review is explicit

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
polar Ready Ready Preview, Comment Apr 24, 2026 6:11am
polar-sandbox Ready Ready Preview, Comment Apr 24, 2026 6:11am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Preview Environment
URL: https://polar-preview-vm.taildbff7b.ts.net/pr-10837
API: https://polar-preview-vm.taildbff7b.ts.net/pr-10837/v1/
Logs: backend
SHA: 59ef65c5b9d927084fc65c6c2de69b5f3b763440

@pieterbeulque
Copy link
Copy Markdown
Contributor

I was about to open a similar issue just now. Thanks for this.

I introduced this issue by moving the POST /v1/organizations to step 3. In our initial onboarding, step 2 did the POST /v1/organizations and step 3 was a PATCH /v1/organizations/:id. However, a PATCH that sets the organization details has the side-effect of triggering an organization review.

I merged the two steps in a single API call to avoid triggering a premature organization review. So, another fix could be to decouple the organization review initialization from the PATCH /v1/organizations endpoint, then revert the onboarding to a POST on step 2 + a PATCH on step 3, and just rely on the API to validate the slug.

As another option, I was considering maybe adding a private /validate-slug endpoint that validates a slug without trying to create the organization.

Do with it whatever you want 😁

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

OpenAPI Changes

Operations

  • 🔼 POST /v1/organizations/{id}/submit-review (added)

@Yopi
Copy link
Copy Markdown
Contributor Author

Yopi commented Apr 8, 2026

@pieterbeulque took your advise, and reverted the POST/PATCH in the organization creation, and added a specific endpoint to submit review which we call from the dashboard

@Yopi Yopi requested a review from pieterbeulque April 9, 2026 11:39
@Yopi Yopi force-pushed the Yopi/onboarding-name-errors branch from 3ab9a5d to 895d651 Compare April 13, 2026 07:48
@Yopi Yopi changed the title onboarding: Validate slug length on correct step onboarding: Separate submit for review to other endpoint Apr 13, 2026
@Yopi Yopi force-pushed the Yopi/onboarding-name-errors branch 2 times, most recently from 33ccc96 to 7bd1b61 Compare April 13, 2026 08:02
Yopi added 3 commits April 24, 2026 08:04
And then PATCH it with business details
We store the details and call the specific endpoint when the user is submitting their org for review.
This is hidden from the external API.
@blacksmith-sh
Copy link
Copy Markdown
Contributor

blacksmith-sh Bot commented Apr 24, 2026

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
TestUpdateOrganization/test_submit_for_review_requires_relevant_fields[anonymous] View Logs

Fix in Cursor

await self._after_update(session, organization)
return organization

def _validate_review_submission(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would love us to find a way to use a proper Pydantic schema for this rather than manually spinning up validation logic like this

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.

3 participants