-
-
Notifications
You must be signed in to change notification settings - Fork 10
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 custom endpoint for GET posts #109
Conversation
71e388a
to
348bf51
Compare
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.
@yoko consider adding unit tests. That way we can mock the shape of the response and make sure these endpoints respect the shape that is expected (that is content is similar to the current content API)
@raisedadead I tried adding tests according this document: https://docs.strapi.io/dev-docs/testing#set-up-a-testing-environment However, the test environment uses Could you take a look at the current code and see if I'm going the right path? With the current code, I can run the test from the console like this: |
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.
Hey Yoko, I just noticed a few code style things that could be improved:
That is perfectly fine, as none of our code is Postres-specific. We are good here because we will do everything using Strapi's backend. |
Co-authored-by: Oliver Eyton-Williams <[email protected]>
Thank you for your review, @ojeytonwilliams @raisedadead I have applied Oliver's suggestions and added one more test case to check the behavior of the |
Getting this change in for now. If there are any issues, I'll work on them in a separate PR. Thanks. |
Checklist:
Update index.md
)Partially implements #94
This PR adds the following 3 endpoints replicating the current API:
Each endpoint accepts query parameter
include=authors,tags
to include author and tags in the response.