Skip to content

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

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

Merged
merged 8 commits into from
Feb 25, 2024

Conversation

estebanx64
Copy link
Contributor

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
Contributor 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
Member

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 fastapi:master Feb 25, 2024
gusevyaroslove pushed a commit to gusevyaroslove/fastapi-template that referenced this pull request Aug 4, 2024
… add CI tests (fastapi#599)

Co-authored-by: Esteban Maya Cadavid <emaya@trueblue.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy