Skip to content
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

Make owner optional in experiment POST endpoint. #2133

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

romain-growthbook
Copy link
Contributor

Features and Changes

This PR addresses the changes described in #1928. It makes owner body argument optional and uses the request's userId for its value when available and no owner has been spericified.

Copy link

github-actions bot commented Feb 16, 2024

Deploy preview for docs ready!

✅ Preview
https://docs-q8iwc63mo-growthbook.vercel.app

Built with commit 170ccd3.
This pull request is being automatically deployed with vercel-action

@@ -47,20 +47,26 @@ export const postExperiment = createApiRequestHandler(postExperimentValidator)(
);
}

const user = await getUserByEmail(owner);
const ownerId = await (async () => {
if (!onwerEmail) return req.context.userId;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original feature request specification is:

if the auth was done via a personal access token, and an owner property wasn't provided, we should default to the owner of the personal access token.

Is that the right interpretation?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's correct

Copy link

github-actions bot commented Feb 16, 2024

Your preview environment pr-2133-bttf has been deployed.

Preview environment endpoints are available at:

@romain-growthbook romain-growthbook merged commit 651280b into main Feb 16, 2024
5 checks passed
@romain-growthbook romain-growthbook deleted the romain/optional-experiment-owner branch February 16, 2024 16:21
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.

[Feature] Update Experiment REST API POST endpoint to make owner optional
3 participants