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 projects API #437

Merged
merged 4 commits into from
Nov 21, 2023
Merged

Add projects API #437

merged 4 commits into from
Nov 21, 2023

Conversation

jfreda
Copy link
Collaborator

@jfreda jfreda commented Nov 18, 2023

This PR adds APIs for creating and updating projects and their associated related resources (both API versions v1 and v2 are handled by the same code).

New API Endpoints

  • /api/v1/projects: GET, POST
  • /api/v1/projects/{project_id}: GET, PATCH
  • /api/v1/projects/{project_id}/related-resources: GET, POST, PUT
  • /api/v2/projects: GET, POST
  • /api/v2/projects/{project_id}: GET, PATCH
  • /api/v2/projects/{project_id}/related-resources: GET, POST, PUT

@jfreda jfreda requested a review from a team as a code owner November 18, 2023 02:32
internal/api/v2/projects.go Outdated Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Outdated Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Outdated Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Outdated Show resolved Hide resolved
internal/api/v2/projects_related_resources.go Outdated Show resolved Hide resolved
Comment on lines +345 to +346
{"/api/v1/products", apiv2.ProductsHandler(srv)},
{"/api/v1/projects", apiv2.ProjectsHandler(srv)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why we would add v1 endpoints for projects given it is a brand new feature? Is this to support some type of backwards incompatibility?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The API version is (more or less, currently, but there's a draft PR #399 that might make this explicit) global for all frontend fetch calls, so I wanted to make sure that this is supported in v1 of the API as well (while it exists). The same code is used for both API versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense!

Co-authored-by: Anubhav Mishra <anubhavmishra@users.noreply.github.com>
@jfreda jfreda merged commit 1e1e503 into main Nov 21, 2023
2 checks passed
@jfreda jfreda deleted the jfreda/projects-api branch November 21, 2023 20:47
@jfreda jfreda mentioned this pull request Nov 21, 2023
@jfreda jfreda added the enhancement New feature or request label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants