-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add public API endpoint for public collections #2174
base: public-collections-feature
Are you sure you want to change the base?
Add public API endpoint for public collections #2174
Conversation
If org with provided slug doesn't exist or no public collections exist for that org, return same 404 response with a detail of "public_collections_not_found" to prevent people from using public endpoint to determine whether an org exists. Endpoint is /api/public-collections/<org-slug> to avoid collisions with existing org and collection endpoints.
This will be more easily extensible if we want to add additional fields (like an organization description) that would be visible in a public profile.
Converting to draft while I make changes |
Made all of the changes except the 404 -> 200 change. Also restructured the response a bit to look like:
|
Also tagged @ikreymer to see if he has thoughts/comments/suggested changes (overall and/or on the 404 question) |
Added support for a public org description (editing via same /public-profile endpoint that's used to enable/disable public profile), as requested in #1051 (comment) |
Some additional changes made:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Tested with #2172
Fixes #1051
If org with provided slug doesn't exist or no public collections exist for that org, return same 404 response with a detail of "public_profile_not_found" to prevent people from using public endpoint to determine whether an org exists.
Endpoint is
GET /api/public-collections/<org-slug>
(no auth needed) to avoid collisions with existing org and collection endpoints.@SuaYoo happy to make any changes needed for the frontend, just lmk!