-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat: Add Pagination Support to GET /api/v1/activity-log Endpoint #1197 #1223
base: dev
Are you sure you want to change the base?
Changes from 10 commits
42d1155
7edb452
85ca844
13f72fa
32054f8
c0c96d2
fba6641
3f10de4
81df0ec
092804f
9f8ec56
e82d3e6
2d125b6
dff8690
f2f8f67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,3 +173,35 @@ cython_debug/ | |
#.idea/ | ||
|
||
alembic/versions | ||
|
||
# Ignore environment files | ||
.env | ||
.env.* | ||
.ven | ||
.venv | ||
env | ||
alembic/env.py | ||
|
||
# Ignore environment and virtual environment files | ||
.env | ||
.env.* | ||
.ven | ||
.venv | ||
env | ||
alembic/env.py | ||
|
||
# Ignore environment and virtual environment files | ||
.env | ||
.env.* | ||
.ven | ||
.venv | ||
env | ||
alembic/env.py | ||
|
||
# Ignore environment and virtual environment files | ||
.env | ||
.env.* | ||
.ven | ||
.venv | ||
env | ||
alembic/env.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the repitions?? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ GRANT ALL PRIVILEGES ON DATABASE hng_fast_api TO user; | |
|
||
**Starting the database** | ||
after cloning the database, dont run | ||
`alembic revision --autogenerate -m 'initial migration'` | ||
`embic revision --autogenerate -m al'initial migration'` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert this |
||
but run | ||
`alembic upgrade head` | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from fastapi import APIRouter, Depends, status, HTTPException | ||
from fastapi import APIRouter, Depends, status, HTTPException, Query | ||
from fastapi.encoders import jsonable_encoder | ||
from sqlalchemy.orm import Session | ||
from api.v1.models.user import User | ||
|
@@ -30,11 +30,17 @@ async def create_activity_log( | |
) | ||
|
||
|
||
|
||
@activity_logs.get("", response_model=list[ActivityLogResponse]) | ||
async def get_all_activity_logs(current_user: User = Depends(user_service.get_current_super_admin), db: Session = Depends(get_db)): | ||
'''Get all activity logs''' | ||
|
||
activity_logs = activity_log_service.fetch_all(db=db) | ||
async def get_all_activity_logs( | ||
page: int = Query(1, ge=1), | ||
limit: int = Query(10, le=100), | ||
current_user: User = Depends(user_service.get_current_super_admin), | ||
db: Session = Depends(get_db) | ||
): | ||
|
||
"""Get paginated activity logs""" | ||
activity_logs = activity_log_service.fetch_all(db=db, page=page, limit=limit) | ||
Comment on lines
+42
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just passing the page and page limits doesn't mean it's reflected in the implementation. |
||
|
||
return success_response( | ||
status_code=200, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this deleted, revert it