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

Fix response model for DELETE /group endpoint #427

Open
4 tasks
JenySadadia opened this issue Dec 5, 2023 · 0 comments
Open
4 tasks

Fix response model for DELETE /group endpoint #427

JenySadadia opened this issue Dec 5, 2023 · 0 comments

Comments

@JenySadadia
Copy link
Collaborator

Related to #321

API endpoint DELETE /group/<group-id> is implemented for deleting user groups matching provided group ID.

The handler delete_group has a pagination response model PageModel even if the endpoint is not returning anything. This adjustment was required to use DB method db.find_by_attributes method in the handler to get the required information before deleting the group. As the DB method is returning paginated response, I needed to declare response_model=PageModel in the handler to use it as per fastapi-pagination package requirements. Please see the comment for more details on the issue.

This can be fixed by using pagination_ctx from fastapi-pagination package that was introduced in version 0.12.0 as mentioned in uriyyo/fastapi-pagination#590. However, it requires fastapi>=0.80.0 version to use it.

Below is the error log when I tried to install fastapi-pagination 0.12.0:

ERROR: Cannot install -r docker/api/requirements.txt (line 4) and fastapi[all]==0.68.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    fastapi[all] 0.68.1 depends on fastapi 0.68.1 (from https://files.pythonhosted.org/packages/df/44/ee1976b03404318590bbe4b0ef27007ce2c42b15757aa0c72bc99a4ebae7/fastapi-0.68.1-py3-none-any.whl#sha256=94d2820906c36b9b8303796fb7271337ec89c74223229e3cfcf056b5a7d59e23 (from https://pypi.org/simple/fastapi/) (requires-python:>=3.6))
    fastapi-pagination 0.12.0 depends on fastapi>=0.80.0

Checklist to complete the issue:

  • Upgrade fastapi
  • Upgrade fastapi-pagination
  • Fix delete_group handler
  • Test on staging
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

No branches or pull requests

1 participant