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

Add ids to the public API #1429

Open
wants to merge 20 commits into
base: staging
Choose a base branch
from
Open

Conversation

JulianVennen
Copy link
Contributor

@JulianVennen JulianVennen commented Dec 17, 2024

This PR exposes IDs for Users, Projects, and Versions on the APIs and accepts them in all endpoints that previously accepted slugs as requested in #1303.
Since version IDs identify a version even without the project being specified, I also added endpoints for that.

The methods implementing the Public API endpoints now accept a UserTable/ProjectTable/ProjectVersionTable object instead of the slug. These are resolved from the slug/id provided in the request path. The Project(Version)Table was already required by the VisibilityVoter for most endpoints and is reused without fetching it from the database twice.

Some queries can also be simplified to remove additional joins that were only used to resolve a project slug. I did that where I noticed it, but I'm sure I've missed some.

@JulianVennen JulianVennen marked this pull request as ready for review December 20, 2024 15:04
@JulianVennen JulianVennen changed the title WIP: Add ids to the public API Add ids to the public API Dec 20, 2024
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.

2 participants