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

♻ Refactor items and services endpoints to return count and data, and add CI tests #599

Merged
merged 8 commits into from Feb 25, 2024

Conversation

estebanx64
Copy link
Collaborator

Refactor items and services endpoints and added support to run pytest within docker-compose and actions

statement = select(User).offset(skip).limit(limit)
users = session.exec(statement).all()
return users

return UsersOut(data=users, count=count)

Choose a reason for hiding this comment

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

why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Front end needs to know how many items are in database to be able to create a pagination

@tiangolo tiangolo changed the title ♻️ [EDIT]: Refactor items and services endpoints and added support to run pytest ♻ Refactor items and services endpoints to return count and add CI tests Feb 25, 2024
@tiangolo tiangolo added the feature New feature or request label Feb 25, 2024
@tiangolo tiangolo changed the title ♻ Refactor items and services endpoints to return count and add CI tests ♻ Refactor items and services endpoints to return count and data, and add CI tests Feb 25, 2024
@tiangolo
Copy link
Owner

Great, thanks! I updated it a bit, mainly to match the previous GitLab CI config, mainly to avoid race conditions between migrations running and the tests starting before the app/DB is ready. This is ready! 🚀

@tiangolo tiangolo merged commit f41f443 into tiangolo:master Feb 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants