You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 modelPageModel
even if the endpoint is not returning anything. This adjustment was required to use DB methoddb.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 declareresponse_model=PageModel
in the handler to use it as perfastapi-pagination
package requirements. Please see the comment for more details on the issue.This can be fixed by using
pagination_ctx
fromfastapi-pagination
package that was introduced in version0.12.0
as mentioned in uriyyo/fastapi-pagination#590. However, it requiresfastapi>=0.80.0
version to use it.Below is the error log when I tried to install
fastapi-pagination 0.12.0
:Checklist to complete the issue:
fastapi
fastapi-pagination
delete_group
handlerThe text was updated successfully, but these errors were encountered: