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

feat: add collection notes endpoint #444

Merged
merged 5 commits into from
Dec 18, 2024
Merged

feat: add collection notes endpoint #444

merged 5 commits into from
Dec 18, 2024

Conversation

yolile
Copy link
Member

@yolile yolile commented Dec 13, 2024

closes #443

@yolile yolile requested a review from jpmckinney December 13, 2024 18:33
process/views.py Outdated
@action(detail=True)
def notes(self, request, pk=None):
"""Return the notes for the compiled collection and its parent collection."""
compiled_collection = get_object_or_404(Collection, pk=pk)
Copy link
Member

Choose a reason for hiding this comment

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

Why request the compiled collection? I think it'd be more generic to request the root collection, and then get notes from all child collections.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was following the same approach as the metadata endpoint, as I thought the registry would probably ask for the compiled collection. But you are right and I will change it to the root collection instead

@@ -232,6 +232,21 @@ def metadata(self, request, pk=None):

return Response(metadata)

@action(detail=True)
Copy link
Member

Choose a reason for hiding this comment

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

The other views use @extend_schema to define the output format. This is only to improve the OpenAPI docs. You can create a follow-up issue instead.

@yolile yolile merged commit 6382098 into main Dec 18, 2024
11 checks passed
@yolile yolile deleted the 443-collection-notes branch December 18, 2024 19:02
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.

Create a new endpoint for collection_note
2 participants