Fix: Add pagination to admin appointments endpoint
- Added pagination with page/per_page query params - Fixed N+1 query by using eager-loaded user relationship - Removed unused _get_user_email helper function - Updated frontend to handle paginated response - Regenerated API types
This commit is contained in:
parent
1cd60b4bbc
commit
77e7f98e1e
4 changed files with 70 additions and 28 deletions
|
|
@ -716,8 +716,13 @@ class TestAdminViewAppointments:
|
|||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert len(data) >= 1
|
||||
assert any(apt["note"] == "Test" for apt in data)
|
||||
# Paginated response
|
||||
assert "records" in data
|
||||
assert "total" in data
|
||||
assert "page" in data
|
||||
assert "per_page" in data
|
||||
assert len(data["records"]) >= 1
|
||||
assert any(apt["note"] == "Test" for apt in data["records"])
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_regular_user_cannot_view_all_appointments(self, client_factory, regular_user):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue